3.15. Exercises, Third Set
- 3. Write a program that asks the user to type in the number of people that are expected for dinner, not counting the user. Assuming that the number typed in is n, display a message that says "A table for (n+1) is ready.". For example, if the user types 3, display "A table for 4 is ready.".
- 4. Modify the program from exercise 3 to display an error message if the number of guests is more than 20.
- 5. Write a program that asks the user to type in his or her first name and age. If the age is less than 53, then indicate that the user is a youngster; otherwise, that he or she is getting on in years.
- 6. Write a program that asks the user whether Susan is the world's most tenacious novice. If the answer is "true", then acknowledge the user's correct answer; if the answer is "false", then indicate that the answer is erroneous. If neither "true" nor "false" is typed in, chastise the user for not following directions.
- 7. Write a program that calculates how much allowance a teenager can earn by doing extra chores. Her allowance is calculated as $10 if she does no extra chores; she gets $1 additional for each extra chore she does.
|
www.steveheller.com steve@steveheller.com |