In-class assignment 5 — interactive problem solving
Downloads
Program complimenter.py
- Develop a program that first requests it user to supply an
age
. After reading the age, the program prints out a tasteful compliment based on the supplied age.
- The compliment must indicate that the user looks an age that is five-years less than the supplied age.
- The program is to process a single age input; i.e., the program should not attempt to get more than one input from the user.
Expectation
- The user will supply a single integer input in reaction to the prompt message to supply an age.
Requirements
- The faux (complimentary) age is the user-supplied age minus five years.
- Use separate variables for storing the user-supplied and faux ages.
- All variables should be named indicating their purpose/usage.
- Any numeric value display must be from the value of a variable (i.e., there will never be arithmetic calculations in a
print()
statement).
- The faux age is to be integer.
- Supply a simple and tasteful compliment.
Three different, possible sample runs
- The above section header Three different, possible sample runs means what it literally says. Each below box shows a different program run; i.e., your program is to perform single age calculation each time it is run.
Enter your age: 19
You do not even look 14
Enter your age: 111
You do not even look 106
Enter your age: 20
You do not even look 15
- Be aware that the testing of your program will use ages different than the above.
Suggested code outline
- Prompt user to supply an age
- Convert user reply to integer
- Compute supposed age
- Print the result of the computation
© 2019 Jim Cohoon | Resources from previous semesters are available. |