Introduction to Computer Science I by James Tam | Return to the course web page |
Unless otherwise indicated the features of your program for this assignment is the same the ones for the previous assignment.
Module to implement Type of module Parameters (input) Function return value Description of the module getAge Procedure age Not applicable
- Display a prompt to the user to enter his or her age.
- Read in the age of the user.
determineAgeModifier Function age ageModifier
- Calculate and return the age modifier by finding the remainder of the age divided by 101.
getGender Procedure gender Not applicable
- Display a prompt to the user to enter their gender.
- Read in the gender of the user.
determineGenderModifier Function gender genderModifier
- Determine and return the gender modifier based on the specified gender.
getComputer Procedure computerType Not applicable
- Display a prompt to the user to enter their computer type.
- Read in the user's computer type.
determineComputerModifier Function computerType computerModifier
- Determine and return the computer modifier depending upon the computer type.
generateLuckySum Function ageModifier, genderModifier, computerModifier luckySum
- Calculate and return the lucky sum which is the sum of the age, gender and computer modifiers.
generateRandomSum Function None randomSum (+/- 100)
- Randomly determine whether the value of plus or minus 100 which will be added to the lucky sum and return this value.
generateLuckyNumber Function luckySum luckyNumber
- Determine and return the lucky number which is based on the sum of the value returned by: generateLuckySum and generateRandomSum.
Implementing all the features below correctly can allow you the potential to receive a grade of 'A' (again style and documentation standards must still be met).
The program performs some rudimentary error checking: These assignments fulfill all of the requirements for a 'B-' level submission (or higher) and performs some basic 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.
|
||
|
||
|