Q1: Write a Java program that will display different messages depending on your age. Your program should...

70.2K

Verified Solution

Question

Programming

Q1: Write a Java program that will display different messagesdepending on your age.

Your program should ask the user for his/her name and their agein years

and give one or more answers from the following ones below:

  • if the age of the user is less than 16, the program shouldprint on the screen “You are not allowed to drive at themoment”.
  • if the age of the user is less than 18, the program shouldprint on the screen “You are not allowed to vote at themoment”
  • if the age of the user is less than 25, the program shouldprint on the screen “You are not allowed to rent a car at themoment
  • if the age of the user is greater than or equal with 25, theprogram should print on the screen “You can do anything that islegal”

Answer & Explanation Solved by verified expert
4.0 Ratings (502 Votes)
The answer to this question is as    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students