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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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