Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started