Question: Write a program that asks the user to input the year he was born, and whether or not he had his birthday this year. The
Write a program that asks the user to input the year he was born, and whether or not he had his birthday this year. The program then calculates and shows his age (in years) to the screen.
For example, if the current year is 2017, the user was born in 1991, and NOT had his birthday, the program would write that he was 25 years old. If he had his birthday, then the program would state that he is 26 years old.
Place the program in a loop so the user can enter as many time as he wishes by entering yes and no when asked if he wants to play again.
Write a goodbye message when the user enters no.
Sample result
Please enter the year that you were born: 1991
Have you had your birthday this year? yes/no: no
If you were born in 1991 years old and haven't had your birthday yet, you must be 25 years old.
Do another year calculation? yes/no: yes
Please enter the year that you were born: 1896
Have you had your birthday this year? yes/no: yes
If you were born in 1896 years old and have had your birthday, you must be 121 years old.
Do another year calculation? yes/no: no
Goodbye for now.
!!!! Please use C++.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
