Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions