Sample Outcomes for A02
Return to assignment description
The following are some of the possible outcomes
of running the YearCalculator program for A02.
Note that input is represented by blue text with a grey at the end.
The indicates a place where the user presses the enter key.
Year Calculator
---------------
This program does some input and math to calculate some facts about you and
your family.
By Mark Young (A00000000)
Press enter...
What is your name? Mark Young
What year were you born? 1962
Press enter...
Hi, Mark Young!
Since you were born in 1962, you turn 61 this year.
You will retire about 2027.
Did you know that the average generation is about 27.5 years?
That means that your parents were probably born about 1934,
and your grandparents about 1907.
Say "Hi" to your grandparents from me the next time you see them!
Year Calculator
---------------
This program does some input and math to calculate some facts about you and
your family.
By Mark Young (A00000000)
Press enter...
What is your name? Nelson Rolihlahla Mandela
What year were you born? 1918
Press enter...
Hi, Nelson Rolihlahla Mandela!
Since you were born in 1918, you turn 105 this year.
You will retire about 1983.
Did you know that the average generation is about 27.5 years?
That means that your parents were probably born about 1890,
and your grandparents about 1863.
Say "Hi" to your grandparents from me the next time you see them!
Year Calculator
---------------
This program does some input and math to calculate some facts about you and
your family.
By Mark Young (A00000000)
Press enter...
What is your name? Djenaba
What year were you born? 2001
Press enter...
Hi, Djenaba!
Since you were born in 2001, you turn 22 this year.
You will retire about 2066.
Did you know that the average generation is about 27.5 years?
That means that your parents were probably born about 1973,
and your grandparents about 1946.
Say "Hi" to your grandparents from me the next time you see them!
Year Calculator
---------------
This program does some input and math to calculate some facts about you and
your family.
By Mark Young (A00000000)
Press enter...
What is your name? Ludicrous Apple-Dumpling
What year were you born? 1066
Press enter...
Hi, Ludicrous Apple-Dumpling!
Since you were born in 1066, you turn 957 this year.
You will retire about 1131.
Did you know that the average generation is about 27.5 years?
That means that your parents were probably born about 1038,
and your grandparents about 1011.
Say "Hi" to your grandparents from me the next time you see them!
The following example has had the following changes made:
- The variable representing the current year has been set to 2025.
- The variable representing the age of retirement has been set to 75.
- The variable representing the length of a generation has been set to 30.0.
Year Calculator
---------------
This program does some input and math to calculate some facts about you and
your family.
By Mark Young (A00000000)
Press enter...
What is your name? Mark Young
What year were you born? 1962
Press enter...
Hi, Mark Young!
Since you were born in 1962, you turn 63 this year.
You will retire about 2037.
Did you know that the average generation is about 30.0 years?
That means that your parents were probably born about 1932,
and your grandparents about 1902.
Say "Hi" to your grandparents from me the next time you see them!
Return to
assignment description