Question: Design a modular program that will ask the user to enter person s name & age, determine if the person is Infant, child, teenager, adult,

Design a modular program that will ask the user to enter persons name & age, determine if the person is Infant, child, teenager, adult, or senior. Your program should display the person's name and age group based on the categories listed below as Infant, child, teenager, & adult. If the person's age doesn't fit into these groups, meaning that person is 65 or older, then it should display the age group as a Senior.
A person is considered as:
Infant =1 year or younger
Child = older than 1 but younger than 13
Teenager =13 years & older but less than 20
Adult =20 years & older but less than 65
Senior =65 or older
Your program should do the following :
start
get the name of the person
get the age of the person
check the age group
output the name & age group
end
An example run for each age group is shown below: Note: User input is in bold after each prompt
Enter name: Anna
Enter age: 1
Anna is an infant.
Enter name: Ben
Enter age: 2
Ben is a child.
Enter name: Cindy
Enter age: 12
Cindy is a child.
Enter name: Dan
Enter age: 13
Dan is a teenager.
Enter name: Eve
Enter age: 19
Eve is a teenager.
Enter name: Franco
Enter age: 20
Franco is an adult
Enter name: Gabby
Enter age: 64
Gabby is an adult
Enter name: Hugo
Enter age: 65
Hugo is a senior.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!