Lecture notes for the Introduction to Computer Science I by James Tam | Return to the course web page |
Months with 31 days | January, March, May, July, August, October, December |
Months with 28 days (ignore leap year) | February |
Months with 30 days | April, June, September, November |
If the day of birth exceeds the maximum number of days for a particular month then the program should display an appropriate error message and re-prompt for a valid combination.
Once a valid date of birth has been entered then following formula is used to convert it all to the life path number.
Step 1: Convert each of the birth day, birth month and birth year to a single digit number. |
|
Values already consisting of a single
digit need not be converted
|
|
Values consisting of more than one
digit are broken into individual digits and added together
|
|
If the sum consists of multiple
digits then the process of breaking a number down into individual digits
and adding them together is repeated until a single digit number is
derived. |
|
Step 2: Add the three single digits. |
|
e.g., Birth date: 11/17/1972 Reduced to single digits yields: 2, 8, 1 (previous step) Adding these digits = 2 + 8 + 1 = 11 (this step) |
|
Step 3: Reduce this sum to single digit to yield the life path number. |
|
e.g. 11 = 1+ 1 = 2 |
The program should then display the life path number to the user. It's not required that the program display the specific meaning or interpretations behind a number. (If you are interested in the additional information then you can go the website referenced*). You can find sample program outputs in the course directory under /home/231/assignments/assignment2/outputs.txt or via this [web link].
Although the new concepts introduced are loops and branching, the concepts from previous assignments should also be applied in this assignment such as following good programming conventions, documentation etc.
* The information does not necessary reflect the opinions of the course instructor or the University of Calgary and only reflect the opinions of the website's author or authors.