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

  Explain two methods for categorical data conversion

explain two methods for categorical data conversion. List the advantages and disadvantages of this approach.

  Make use of a regularexpressionvalidator control

make Use of Visual Studio.NET 2005 to create an ASP.NET project with four aspx forms. Use Master Pages to display a company name selected by your group at the top each form.

  Explain basic wireless network maintenance functions

Occasionally after upgrading firmware, the antennas in your wireless network want to be adjusted. What technology may someday eliminate this need for antenna maintenance.

  Identify the functions of a channel service unit

How are they used in the corporate environment.

  Describe the mechanics of Buffer overflows

Prepare a complete tutorial, including an analogy to describe the mechanics and a graphic to support your analogy, on one of the subsequent areas

  Process that handles the customervalidator''s servervalidate

Write down a method that handles the CustomerValidator's ServerValidate event. In addition, write a JavaScript function for the CustomValidator's CustomValidationFunction property. Each method should verify that the user entered an integer in each..

  How can state the units for each metric

express the units for each metric, such as dollars per hour, rejects per day, schedule slippage per task in days, budgeted versus actual cost expenditure per task,etc. One character in a group I once had expressed the progress of laying a cable in..

  Make program to gauge the expected cost of an item

It is tough to make a budget that spans several years, because prices are not stable. If your company needs 200 pencils per year, you cannot simply use this year's price as the price of pencils two years from now. Because of inflation the cost is ..

  How the company can decrease the threats

This solution explores security threats faced by a company when implementing a wireless network. In particular, this solution utilizes a case study to define the threats faced by the company and extrapolates on how the company can reduce the threa..

  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.

  Design function that accepts the cost of the purchase

Write down a function that accepts the cost of the purchase and the amount of the payment as functon parameters, and the prints on the cashiers console how much change to give (how many bills and coin). Consider denominations of 1cent, 5 cents, 10..

  How to create an encryption absolutely unbreakable

How to create an encryption absolutely unbreakable

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