Question: Lab 03 - Practice Using If and If/else Statements - Create a variable of type Scanner and name it input - Read in the user's
Lab 03 - Practice Using If and If/else Statements - Create a variable of type Scanner and name it input - Read in the user's age and assign it to an integer variable called age. Note: be sure to prompt the user before reading in the number. Users don't know what you want unle: you tell them. - Print out if they are a teenager, an adult, or getting old based on their age. A teenager is between the ages of 13 and 17 , an adult is between 18 and 49 , and getting old is 50 and over. - Run the program at least 3 times; using 3 different ages to test each if statement Sample Output: Please enter your age: 14 You are a teenager Please enter your age: 38 You are an adult Pleaser enter your age: 55 You are getting old
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
