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 name and age. If the age is less than 47, 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 ...

Get Learning to Program in C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.