Program that validates the value a user enters into textbox

Assignment Help Visual Basic Programming
Reference no: EM13935185

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: EM13935185

Questions Cloud

A sequential access file or often call a text file in vb.net : In my application I've created a sequential access file or often call a text file in Visual Basic.Net. I am wondering how can I code the program to calculate the average of all the data from the sequential access file?
Write a set of test cases to debug a small vb program. : You have just been hired as the testing guru for the CatchAllBugs.com Company. Your first task is to write a set of test cases to debug a small VB program. Unfortunately, you do not have access to the code of the program. All you have is the follo..
List three likely costs in linda''s operation and indicate : List three likely costs in Linda's operation and indicate whether they are fixed or variable.
Explain what happens to nad : Which other stages of glucose oxidation produce molecules of the reduced coenzyme, NAD.2H? Explain what happens to NAD.2H produced during glycolysis in:- an animal cell respiring aerobically
Program that validates the value a user enters into textbox : Check to see if each part is only numeric characters, using IsNumeric and IndexOf.If error, display error message box.
Literature review on project : Write a report of 2000 words for literature review on project and attempt to understand cultural differences with emphasis on engineering approaches and practices.
Project you are assigned to using bullet points : List of references used (IEEE style) - please specify if none have been used. Please Note, only scenario#3 is to be completed from the 6 provided & the use of Windows 2008 on a virtualbox is required.
Why are mitochondria and erythrocytes red : Why are mitochondria and erythrocytes red? Please answer this question completely. I need a full understanding of why and how this occurs.
Conceptualise the systemic nature of an organisation : Further it is designed to develop and test your knowledge and capacity to conceptualise the systemic nature of an organisation and comprehend, interpret, and execute a specific task description and to present it for evaluation.

Reviews

Write a Review

Visual Basic Programming Questions & Answers

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms". This assignment will contain two (2) Parts: Written Paper and Visual Basic Prototype. The Visual Basic Prototype is not included in the total page count but is included in the e..

  Visual basic programming discussion

The use of decision logic is one of the major concepts of computer programming. The decision takes your code from being sequential to one that can take various options based on the different conditions. Determine the method of coding that you would u..

  Ticketseller

Use Visual basic 2010Visual Basic,  TicketSeller. This assignment will contain two (2) Parts: Event Planning Document and Coding phase. You must submit both parts as separate files for the completion of this assignment. Remember, you are only to de..

  Data storage & "exception error trapping"

Discussion on Data Storage and  "Exception Error Trapping".

  Designing vb applications across multiple platforms

Technical Project "Designing VB Applications Across Multiple Platforms".

  The implementation of server side of the application

Implementation of dynamic content, server side (backend) and database for your web site using Microsoft Visual Studio 2012

  Need help building a vwd website

Need help building a VWD website. This website may not go live. I have little progress as a family tragedy has impeded my time for school.

  To develop a visual basic console application

The aim of the assessment is to develop a Visual Basic console application that performs a number of mathematical functions. The mathematics package will be menu driven, i.e. a number of options will be displayed, and the user will be able to input w..

  Program in basic which prompts user to input two integers

Write down the program by using Small Basic which prompts the user to input two integers: firstNum and secondNum (firstNum must be less than secondNum).

  Develop vb-net application that includes arrays and loops

Develop a VB.NET application that includes arrays, loops, and IF statements to do the following. Your output must also display the number of applicant(s) being interviewed.

  Visual basic program to accept numeral values

Write a VISUAL BASIC program to accept numeral values of any unit, sum up the total, calculate the average, and then Output the result with a proper unit.

  Write a visual logic program to accept series of number

Write a Visual Logic program which accepts a series of numbers, until the first negative value is entered. The maximum number of non-negative input values is 250.

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