Give method to separate the input string into 3 parts

Assignment Help Computer Engineering
Reference no: EM1333124

Design and develop a program that validates the value a user enters into a TextBox control to ensure that the entry is a valid telephone number. The application should accept a maximum of 12 characters. When the user clicks a button, the program should determine if the entry is of the form 999-999-9999, where the character 9 represents any number.

If the entry is determined to be a telephone number, display an appropriate message, along with the separate substrings that compose the telephone number without the dashes. If the entry is not a telephone number, then display a message as to the reason why the entry is not a valid telephone number, clear the TextBox control and set focus to the TextBox control. Use String class methods to solve the problem.

Here are a few hints to help you code the String methods:

Check that the user has entered two dashes in the appropriate spaces.

Break the string into 3 substrings, represented as 999,999, and 9999.

Use the Visual Basic .NET IsNumeric() function to determine whether each substring is a valid number. The function accepts one parameter and returns a True or False value.

Focus():
syntax: control.Focus() , where control is the name of a control that will receive focus during run time.
Example: cmbCreditRating.Focus()

The cmbCreditRating control receives focus when the above statement is executed

IsNumeric() as explained in the assignment
IsNumeric does not filter dash "-", comma "," or decimal point "." characters so your program must use IndexOf to filter for these characters in your substrings

Logic:

There are many ways to give user feedback on the correctness of the input. Some are more user friendly than others. However, it may require a lot of coding to account for various situations.

The simple way is the following:

First check the length of the input string: it must be exactly 12.

Then check for Substring(3, 1) and Substring(7, 1),i.e. the fourth and eighth character must be "-"

Use the Substring method to separate the input string into 3 parts

Check to see if each part is only numeric characters, using IsNumeric and IndexOf.

If error, display error message box.

You don't have to use loops (you can if you want to), but you have to use the if-then-else statement

save all files as "teleapp" and zip all files, name zip folder "teleapp"

Reference no: EM1333124

Questions Cloud

Question about capital asset pricing model : What are the critical assumptions in Capital Asset Pricing Model (CAPM)? How do these affect its validity as a way to estimate equity cost of capital?
Incremental analysis used in decision making : What is incremental analysis? How is the concept used in decision making?
This solution will focus on the negative impacts of nafta : This solution will focus on the negative impacts of NAFTA from two main fronts: the negative impact on trade and negative impact on employment.
You have a sole proprietorship merchandising business : You have a sole-proprietorship merchandising business dealing with photography equipments. The business was established three years back, and it had an average annual turnover of $50,000.  How will you qualify the customers as to whether or not they..
Give method to separate the input string into 3 parts : Design and make a program that validates the value a user enters into a TextBox control to ensure that the entry is a valid telephone number. The application should accept a maximum of 12 characters. When the user clicks a button, the program shou..
Define circumstance company involved in ebusiness projects : In what circumstance should various organizations company be involved in e-Business projects
The first step in comprising the value of this stock today : The first step in comprising the value of this stock today, is to compute the value of the stock when it reaches constant growth in year.
Fuel and environmental improvement : Should responsibility for environmental improvements be shared among the more wealthy countries rather than the countries that currently pollute the most?
Stock price determination - capm : The stock of Preston Inc. is expected to pay a dividend of $6.00 during the ensuing year and is expected to grow at a constant rate of 8% in the foreseeable future. Assuming a required rate of return of 14% and a risk free rate of 6%, determine a p..

Reviews

Write a Review

Computer Engineering Questions & Answers

  The hard drive will the original query take

suppose (somewhat artificially) that RAM can hold 200 rows and devotes half of that to reading one table and half to reading the other table and has "other places" to store the subquery/query results.

  Compute the integer part of the quotient

Calculate an integer remainder when integer a is divided by integer b.

  Contemporary information technology

Explain a contemporary information technology issue for which our society’s moral guidelines appear to be nonexistent or unclear.

  Why compression algorithms are frequently used in forensics

why Compression algorithms are frequently used in forensics.how they can potentially affect evidence, paying particular attention to algorithms implemented by forensic tools. You need to be clear yet concise.

  The application must calculate the average

make a Java Application that will ask the user for his or her name and to enter in three numbers. The application should calculate the average and then output the value to the user.

  How to generate a hub-and-spoke network

How to generate a hub-and-spoke network

  Write down the definitions for a double-stack structure

Write down the definitions for  a double-stack structure

  Image smoothing with gaussian masks and c++

Implement the image smoothing utilizing the convolution with Gaussian masks with C++. You must utilize 2 input images which are pgm files. First, implement 2D Gaussian convolution utilizing the 1D Gaussian masks.

  Spreadsheet model of the heat transfer situation

Spreadsheet model of the heat transfer situation

  Declare two variables of type course

Declare two variables of type course.

  Find user allowed to purchase particular restricted product

I need to create a simple age calculator to find if a user is allowed to purchase a particular restricted product. I need to model an abstract class to represent generic restricted product and concrete classes to represent alcohol, tobacco, R-rate..

  Declare three variables as integer

Log in to the Linux system as a user, and then open a Terminal emulation window.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd