-
Please help with program
A twelve hour clock; stores hours, minutes, seconds, AM or PM. Intitial hours, mins, secs are 0 by default. User is requested for the entries. Then the clock is advanced by seconds one by one.
The user is given a statement to stop the clock such as "press a key to stop clock", then once the user has hit a key, the clock stops 'ticking' and is displayed to the user with the delay added.
I was hoping that anyone could provide me with a *simple* solution (i.e. only with classes, concrete data types and basic c++) , I posted mine earlier but it was'nt that good. Any help will be appreciated.
Thanks!
-
just one class is needed...
class clock{
int hrs;
int mins;
int secs;
bool DN = 0; // Day or Night - 0 for day, 1 night AM/PM
function print(){
//where you cout>> statement
}
};
Main(){
//invoke the class
//Create loop to continuosly update and print out time
}
Obviously this is just psuedo code but should help if you're having trouble with design.
-
Do mean something like a timer?!
-
thanks
Thanks for the help ... I know how to make my original code even cleaner than before. Woohoo! thanks everyone.:)