Question: Write a C++ program using if-else statements, switch statements, and/or loops (for, while, do- while) that prints a months calendar after prompting the user inputs.

Write a C++ program using if-else statements, switch statements, and/or loops (for, while, do- while) that prints a months calendar after prompting the user inputs. Your program must validate all the user inputs (or keep prompting the user inputs until the user enters valid inputs), display a formatted calendar, ask the user if they want to print another calendar (y), repeat the program until the user enters 'n', and then exit with the final message.
Note:
You can use setw() function in the library
Program Inputs
Enter a month (1 to 12):
- If user enters an invalid option, keep displaying this prompt until a valid input is entered Enter days in the month (28, 29, 30, or 31):
- If user enters an invalid option, keep displaying this prompt until a valid input is entered Enter start day (0 to 6):
- If user enters an invalid option, keep displaying this prompt until a valid input is entered
Program Outputs
A formatted calendar is displayed according to the valid user inputs (see the sample output
below).
Would you like to print another month (y)?
- A Question for repeating (y)
- User will always enter y or n.
- If user enters y, display the initial prompt Enter a month (1 to 12): again.
- If user enters n, display the final message Thank you for using this program. Goodbye!
and terminate the program
 Write a C++ program using if-else statements, switch statements, and/or loops

the right track. To guarantee full credit, your program's ou below. Test Cases: Welcome to Calendar Printer! Enter a month (1 to 12): 13 Enter a month (1 to 12): 0 Enter a month (1 to 12): 1 Enter days in the month (28, 29, 30, or 31): 25 Enter days in the month (28, 29, 3e, or 31): 33 Enter days in the month (28, 29, 30, or 31): 31 Enter start day (@to 6): 6 JANUARY Sun Mon Tue Wed Thr Fri Sat 1 2 3 4 5 6 7 B 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 Would you like to print another month? (y) y Enter a month (1 to 12): 2 Enter days in the month (28, 29, 30, or 31): 28 Enter start day (@to 6): 2 FEBRUARY Sun Mon Tue Wed Thr Fri Sat 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 Would you like to print another month? (y) y NGON Enter a month (1 to 12): 9 Enter days in the month (28, 29, 30, or 31): 38 Enter start day (e to 6): 4 SEPTEMBER Sun Mon Tue Wed Thr Fri Sat 4 11 18 25 5 12 19 26 6 13 20 27 7 14 21 28 1 2 8 9 10 15 16 17 22 23 24 29 3e Would you like to print another month? (y) n Thank you for using this program. Goodbye

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!