Question: Write a C++ program that will create a digital clock. The clock should print out a heading for hours, min and sec and should appear

Write a C++ program that will create a digital clock. The clock should print out a heading for hours, min and sec and should appear in the middle of the screen. Arrange the timing of the clock so that the hours, min and sec track as close as possible to a real clock. The clock will work on classical time with distinction of Am and PM. What this means is that the clock displays from 0 hours to 12 noon as AM and then converts to 1 to 12 PM hour time. So the output would look like

HOURS MIN SEC

2 24 47 PM

The program must contain a "while" loop, a "for" loop and "do while" loop. Hint use the "cls" comand , the #include command and use of "if" statements to decide between Am and PM.

You will need to use the command system("cls") to clear the screen.

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!