Question: Write a Java program that asks the user for their age. If the age is greater than or equal to 18, print Congratulations! You are
Write a Java program that asks the user for their age. If the age is greater than or equal to 18, print "Congratulations! You are an adult. You can vote". Otherwise print "You are not 18 yet. Enjoy your carefree days!".
What are the input values available to the program? What is the source of these values?
What other objects and methods are needed to read the input values?
How many variables are needed in this program? List their names and types.
What are some sample input values that we should test our program with?
Write a simple algorithm in plain English listing the steps that need to be followed to get the desired output.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
