Page 1 of 1

Write a program that does the following. Prompt a user to enter their age. Make sure the user can only enter a number be

Posted: Sun May 15, 2022 11:40 am
by answerhappygod
Write A Program That Does The Following Prompt A User To Enter Their Age Make Sure The User Can Only Enter A Number Be 1
Write A Program That Does The Following Prompt A User To Enter Their Age Make Sure The User Can Only Enter A Number Be 1 (26.95 KiB) Viewed 44 times
Can't figure out to program this. Java
Write a program that does the following. Prompt a user to enter their age. Make sure the user can only enter a number between 1 and 200. Prompt the user to enter another age if they input the a number out of range. If the user is under 18, call a separate method to ask the user how many books they have read, return the value to the main method and print the If the user is between 18 and 49, call a separate method to ask the user how many cars they have driven, return the value to the main method and If the user is 50 or older, call a separate method to tell them they are not old enough. Calculate the number of days the user has lived and print the answer. Il sample output 1 Enter your age 52 You are not old enough You have lived for 18,980 days Il sample output2 Enter your age 12 How many books have you read? 20 You have read 20 books! You have lived for 4,380 days l/sample output3 Enter your age 25 How many cars have you driven? 8 You drove 8 cars! You have lived for 9,125 days ets Il sample output4 Enter your age 520 *****Number out of Range* Enter your age 52 You are not old enough You have lived for 18,980 days