Question: Please, input user password: abcABCO& The user PhuongLh17 has password abcABC0&. Q28: Write a Java program to accept the phone and the age and print

 Please, input user password: abcABCO& The user PhuongLh17 has password abcABC0&.

Q28: Write a Java program to accept the phone and the age

Please, input user password: abcABCO& The user PhuongLh17 has password abcABC0&. Q28: Write a Java program to accept the phone and the age and print out them. The phone should begin with a '' or a 'O' followed by 9 to 11 digits. If the does not match the requirements, a message "The phone number is not valid!" is printed out and the user is required to input again. If the input age is not an integer, a message "The age should be an integer number." is printed out and the user is required to input again. If the input age is smaller than 18, a message "The age should be >= 18." is printed out and the user is required to input again. Print out the input information, for example "The phone is +84785645567. The age is 18" Create your own exception class named for example Invalidinput which is a checked exception type. Modify the inputData1() to accept the phone number, the inputData() to accept the age and modify the main() method to print out the result. - 29 DELL The user interface may be: Nguyen Van A - SE1649 - HE 165250 Please, input phone number: 0912345 The phone number is not valid! Please, input phone number: a890097987 The phone number is not valid! Please, input phone number: +84785645567 Please, input the age: a The age should be an integer number. Please, input the age: 15 The age should be >= 18 Please, input the age: 18 The phone is +84785645567. The age is 18 DELL

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!