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 or older, then it should display the age group as a Senior.
A person is considered as:
Infant year or younger
Child older than but younger than
Teenager years & older but less than
Adult years & older but less than
Senior 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:
Anna is an infant.
Enter name: Ben
Enter age:
Ben is a child.
Enter name: Cindy
Enter age:
Cindy is a child.
Enter name: Dan
Enter age:
Dan is a teenager.
Enter name: Eve
Enter age:
Eve is a teenager.
Enter name: Franco
Enter age:
Franco is an adult
Enter name: Gabby
Enter age:
Gabby is an adult
Enter name: Hugo
Enter age:
Hugo is a senior.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
