This assignment is intended to see if youve learned the basic concepts talked about thus far in the lectures.

Program

You will need to use cout, cin, variables and operators.

The purpose of the program is to determine the number of whole half decades (5 years, sometimes called a lustrum) a person has lived; given the year they were born.

  • The program should ask the user for the year they were born (not their age)
  • The program can either ask for the current year or initialize a variable to store the current year or retrieve it from the system (but it must be cross platform compatible)
  • It will tell the user how many complete lustrums they have lived for, the result should be stored and shown as a whole number (integer) only.

Sample output:

In what year were you born?
1939
You have lived for 15 half-decades
In what year were you born?
1963
You have lived for 10 half-decades
In what year were you born?
2015
You have lived for 0 half-decades
Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.