Question: 6. Write a complete C++ program that prompts the user for the time (two integers; hour and minute) and whether it is AM or PM.
6. Write a complete C++ program that prompts the user for the time (two integers; hour and minute) and whether it is AM or PM. If the user enters 9:00 AM, tell them it is time for breakfast. If the user enters 5:30 PM, tell them it is time for dinner. If the user enters a time after 8:00PM, tell them it is time for an evening snack. If none of the above times are entered, tell the user it is not time eat. Sample run of program: Enter the current time. Hour: 7 Minute: 43 AM or PM? AM It's not time to eat. Another sample run of program: Enter the current time. Hour: 5 Minute: 30 AM or PM? PM Time for dinner! Another sample run of program: Enter the current time. Hour: 8 Minute: 37 AM or PM? PM Time for evening snack
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
