The Introduction to multidisciplinary Computer Science II by James Tam | Return to the course web page |
Aside from the 'main' method you are not to write static methods for this assignment. (If you don't know what I'm referring to by static methods, I will be discussing this topic later in the course).
1) The person's age |
2) The person's house or apartment number. |
3) The person's pet |
1) Age
This value must be a positive integer between 1 and 113 (inclusive). The age modifier will be the remainder of dividing the person's age by 100. If the user enters a value outside of this range then the program should provide an error message and assume that age is the default of 27.
2) Address
The person enters in a positive integer between 1 and 9999 (inclusive). If the user enters a value outside of this range then the program should provide an error message and assume a default address of 4944.
The address modifier will be equal to the remainder of dividing the address by 100.
3) Type of pet
Finally the person must indicate what type of pet that he or she owns, the values for the pet modifier are shown in the table below. If the person does not provide one of these answers then the program will automatically set the as a default value "no pet" so that the pet modifier will be set to 2. (That means that the variable storing the pet information should indicate that the person does not have a pet and the pet modifier should be determined from this value and an error message should be displayed). To keep it simple the program should accept the user's input as a single character e.g., 'n' for no pet but it should be able to handle lower or upper case values. (Run the sample executable to see how this is supposed to look).
Pet
Pet modifier No pet 2 Fish 5 Dog 6 Cat 7 Reptile 8 Other 9 Multiple pets 10
The program will then display the numerical fundex value as well as providing a text description of what the numbers mean:
Fundex value | Description | |
000 - 499 | What a bore! | |
500 - 999 | A genuinely fun person. | |
1000 - 1499 | A real wit. | |
Over 1500 | A party animal! |
Finally the program will employ a loop so that 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.
1 Note: The fundex 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 your success at social interactions.