| Introduction to Computer Science I by James Tam | Return to the course web page |
1) The person's birth information |
2) The type of car driven |
3) The person's phone number |
1) Birth information
There are two parts to this section: the month of birth and the year of birth. The birth month will be entered as a numeric value corresponding to the order of the month e.g., January is the first month so the person would enter 1, February is the second month so the person would enter 2 etc. The year of birth is entered as a four digit integer value. The birth modifier is calculated by adding the birth information together and then calculating the remainder of this sum divided by 102. For example if the person was born on November, 1976 then the birth modifier would be calculated as follows:
birth modifier = (11 + 1976) MODULO 102
= 1987 MODULO 102 = 49
2) Vehicle information
The program will prompt the user to enter in a single character based upon the type of car that he or she drives:
Vehicle driven Character to input Vehicle modifier Other (not listed below) e.g., Minivan 'O' or 'o' 40 No car ''N' or n' 50 Compact e.g., Smart Fourtwo 'C' or 'c' 60 Jeep/SUV e.g., Toyota RAV4 'J' or 'j' 70 Sports car e.g., Eagle Talon 'S' or 's' 80 Luxury car e.g., Rolls Royce Phantom 'L' or 'l' 90 Hybrid e.g., Chevy Silverado 'H' or 'h' 100 3) Phone number
The final question requires that the person enters that last two digits of their home or primary phone number. The phone modifier is equal to this number.
The program will then display the numerical happydex value as well as indicating what happiness category that the person falls under:
| Happydex value | Description | |
| 0 - 99 | Content: You have an equal balance of happy and sad events in your life. |
![]() |
| 100 - 199 | Glad: Life almost always looks good to you. |
![]() |
| 200 - 300 | Ecstatic. Homer Simpson's famous exclamation best describes your life: 'Woohoo!' |
![]() |
These assignments implement all of the required functionality listed above. Assignment submissions must follow also follow good coding style and be fully documented.
Implementing either of the features listed below can increase your grade by a full letter (e.g., 'C' to 'B'). Implementing both features correctly can allow you the potential to receive a grade of 'A' (style and documentation standards must still be met).
Feature 1: These assignments fulfill all of the requirements for a 'C' level submission and performs some rudimentary error checking. If an invalid value is entered the program will generate an appropriate error message and a default value will be used by the program.
Feature 2: These assignments fulfill all of the requirements for 'C' level submission but it automatically re-runs itself. Each time that a calculation has been performed the program will prompt the user if he or she wishes to run the program again or if they want to exit the program.
2. Include a README file in your submission: For this assignment your README file must indicate what grade level has been completed (A, B or C). This will allow your marker to quickly determine what he or she must look for and speed up the marking process.
3. Assignments (source code/'dot-p' file and the README file) must be electronically submitted via submit. In addition a paper print out of the source code and README must be handed into the assignment drop box (located on the second floor of the Math Sciences building) for the tutorial that you are registered in. Electronically submitting the assignment allows your marker to run the code in order to quickly determine what features were implemented. Providing a paper printout makes it easier for your marker to read and flip through your source code.
1 Note: The happydex is to be used for entertainment purposes only and neither I nor the University of Calgary provides any express or implicit guarantees that the numbers generated will actually predict the amount of joy that you will receive in this life..