// 22.5HV2 Software Engineering II // Unit 2 Exercise 2 #include #include #include #include "alarm.h" void main() { Alarm_clock timer(10,15); // create timer and set to 10.15am time_t t1, t2; // time_t is struct in time.h timer.set_alarm(); // set alarm time while (true) { // i.e. repeat indefinitely! t1 = time(NULL); // get current time in seconds while (difftime(t2,t1) < 1) { // wait for 1 second t2 = time(NULL); } timer.tick(); // advance timer by 1 second (also check alarm time) timer.show_time(); // display time } }