Purchase Solution

Please create this application using visual basic .net

Not what you're looking for?

Ask Custom Question

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"

Thank you

Purchase this Solution

Purchase this Solution


Free BrainMass Quizzes
Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.