Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.

image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning C# 5.0 Databases

Authors: Vidya Vrat Agarwal

2nd Edition

1430242604, 978-1430242604

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago