Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab 03 - Practice Using If and If/else Statements - Create a variable of type Scanner and name it input - Read in the user's

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Question What is a Roth 403 (b) plan?

Answered: 1 week ago

Question

Question Can a Keogh plan fund be reached by the owners creditors?

Answered: 1 week ago