The whole event takes place on mars, so you can see the different time intervals for minutes, hours and days respectevely at the top.Code://Jonathan Barnwell //COP 3223 Section 1 //Program III //02/23/06 #include <stdio.h> #define HRS_DAY 20 //define hours per day #define MINS_HR 12 //define minutes per hour #define SECS_MIN 15 //define seconds per minute int main(void) { int menu_choice; //Gather user menu choice int h = 0, m = 0, s = 0; //current time int hT, mT, sT; //count time do { //heres my menu printf("Choose one of the following menu options:\n"); printf("1: set time\n"); printf("2: start timer\n"); printf("3: quit\n"); scanf("%d", &menu_choice); if (menu_choice == 1) { printf("What is the current time?\n"); scanf("%d:%d:%d", &h, &m, &s); } else if (menu_choice == 2) { printf("How long would you like me to count?\n"); scanf("%d:%d:%d", &hT, &mT, &sT); //I am supposed to take every second and print it until that interval expires } else if (menu_choice == 3) { printf("Thank you.\n"); } else { printf("Sorry, that is not a valid menu choice.\n"); } } while (menu_choice != 3); return 0; }
I'm supposed to create a menu for the user, (set time/start timer/quit)
as you can see, most of that is already input.
next i am to take the current time and print in seconds until the interval provided expires. (for example using EARTH, if its 2:00:00 and he wants me to count for an hour i'm supposed to print every second until three a clock.)
i hope that makes sense
i don't know how to continue from here
please advise
Michael
PS theres more to it, i'm just trying to understand it step by step



LinkBack URL
About LinkBacks


