// This program should scan in the start time of a movie and the movie length, // then work out whether the movie will finish by a 10:00pm curfew. // // Unfortunately, this code contains a number of errors. // It's your job to fix them, good luck! #include #define CURFEW_HOUR 22 #define MINUTES_IN_HOUR 60 int main(void) { printf("Enter movie start hour: "); int start_hour; scanf("%d", start_hour); printf("Enter movie start minute: "); int start_minute; scanf("%d", start_hour); printf("Enter movie length in minutes: "); int movie_length; scanf("%d", movie_length); int start_total = start_hour + start_minute; int finish_total = start_total - movie_length; int finish_hour = finish_total % MINUTES_IN_HOUR; int finish_minute = finish_total / MINUTES_IN_HOUR; printf("Movie will finish at hour: %lf, minute: %lf.\n", finish_hour, finish_minute); if (finish_total > CURFEW_HOUR * MINUTES_IN_HOUR) { printf("You can watch the movie!\n"); } else { printf("Movie finishes too late!\n"); } return 0; }