Question: Question 1: Repeated Input Validation This program should prompt the user (using the prompts shown below) to input three data fields: Name, Age, and Phone

 Question 1: Repeated Input Validation This program should prompt the user

Question 1: Repeated Input Validation This program should prompt the user (using the prompts shown below) to input three data fields: Name, Age, and Phone Number. Each field should be checked against these specifications: Name must be between 1 and 30 characters long, excluding any leading or trailing spaces. Age must be a number from 0-125 Phone number must be a sequence of exactly ten digits, with no leading zeros. . . If an input value does not meet its specifications, the program should display "Incorrect input" and then repeat the input process for that field only. Once all fields have been input correctly, the input values should be displayed in the format shown below Examples: Enter your name: John Smith Enter your age: 33 Enter your phone number: 5305551212 Name: John Smith Age: 33 Phone Number: 530 555 12 12 Enter your name: John Smith Enter your age: 1234 Incorrect input Enter your age: 45 Enter your phone number: 0053051212 Incorrect input Enter your phone number: 3 Incorrect input Enter your phone number: 5305551212 Name: John Smith Age: 45 Phone Number: 530 555 12 12 Notes: . The do-while loop is appropriate for repeated input validation. The String class method trim will remove leading and trailing spaces from a String

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!