Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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"

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M9208494

Have any Question?


Related Questions in Computer Engineering

During a year of operation a firm collects 650000 in

During a year of operation, a firm collects $650000 in revenue and spends $250000 on labor expense, raw materials, rent, and utilities. The firm's owner has provided $350000 of her own money instead of investing the mone ...

Technology certainly does play a large role in our lives

Technology certainly does play a large role in our lives and this has happened in a very short period of time. It has impacted the way we activities professionally, personally, and academically. For example, online educa ...

Not many applications use this type of direct connection ex

Not many applications use this type of direct connection (ex: ftp, ssh, tenet, smtp, httpd, pop) anymore unless it is within the corporate firewall. Why do you think this is? Pick 1 or 2 as example.

Sample a signal every 05 milliseconds for 16 signal levels

Sample a signal every 0.5 milliseconds for 16 signal levels. Then, transmit this signal through a noiseless channel. What is the data rate? If we double the sample rate, what is the data rate?

Question sql uses relational and logical operators in the

Question SQL uses relational and logical operators in the WHERE clause to restrict the rows returned in a query. What are these operators and what datatypes can they work with?

Question suppose a computer using direct mapped cache has

Question : Suppose a computer using direct mapped cache has 2 20 words of main memory and a cache of 32 blocks, where each cache block contains 16 words. a. How many blocks of main memory are there? b. What is the format ...

Use the normal model n110756 for the weights of steersa

Use the Normal model ?N(1107?,56) for the weights of steers. A) What weight represents the 49th Percentile? B) What weight represents the 99th Percentile? C) What's the IQR of the weights of these steers?

Calculate the probability of selecting a random sample of

Calculate the probability of selecting a random sample of 225 observations with a sample proportion of 0.54 or greater, if the sample population has a population proportion of 0.50.

Explain and discuss the following quotepoliticians can be

Explain and discuss the following quote: "Politicians can be strange. They have been calling for the breakup of firms as diverse as energy companies and tech giants like Microsoft and Google because they believe these co ...

How do you find the mass of solid niso4 x 6h2o i have the

How do you find the mass of solid NiSO4 x 6H2O? I have the molar mass and it is 262.85and I need to find the mass of it. That's what the question is telling me to do.

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As