Question: Write a full C++ program which asks the user to input their age, and then tells the user if they are a child, a teen,
Write a full C++ program which asks the user to input their age, and then tells the user if they are a child, a teen, an adult, or a retiree. A child is defined as age at most 12. A teen is defined as age at least 13 and at most 17. An adult is defined as age at least 18 and at most 64. A retiree is defined as age at least 65. If the user types in a negative age, your program should tell the user that a negative age is an error!
Here is sample output running this program a few times, user input is in bold black:
[mluttrel@hills assignments]$ ./a.out Please input your age: 18 You are an adult. [mluttrel@hills assignments]$ ./a.out Please input your age: 15 You are a teen. [mluttrel@hills assignments]$ ./a.out Please input your age: 3 You are a child. [mluttrel@hills assignments]$ ./a.out Please input your age: -5 Error! Age must be at least 0!
Submission
Create a single .cpp file to submit, using to the "Using hills to write, compile, and run, and submit C++ programs" instructions in Software needed for this course. Follow proper coding style. Don't forget to include your sample output. Your submission must be a plain text file with .cpp extension, it must not be rich text like .rtf or .pdf. As a reminder, you can use any development environment to develop your program, but you must make sure it works correctly on hills before submission.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
