programming C:Programmlng Project #3 1 f 2 EGRE245 Sprmg 2017

programming C:Programmlng Project #3 1 f 2 EGRE245 Sprmg 2017

Programming Project #3 EGRE245 Spring 2017 Find Your Train 1 Overview Commuter trains roll into Gotham train station according to the following schedule (using 24-hour

clock times with 00:00 being midnight): 00:00 – 05:00 every hour 05:00 – 09:00 every 15 minutes 09:00 – 16:30 every 30 minutes 16:30 – 18:00 every 15 minutes 18:00 –

00:00 every 30 minutes Write a complete C program that inputs a time (in 24-hour clock format, e.g. 15:06; see sample run) and outputs the time of the closest

departing train to the time entered. Note that this train could be departing before the time entered. If the time entered is the same amount of time between two

trains, always choose the later train. Your prompts and output should match the sample run exactly (using your name instead of mine!).

Programmlng Project #3
1 f 2 EGRE245 Sprmg 2017
Find Your Train

1 Overv1ew
Commuter trains roll into Gotham train station according to the following schedule (using
24-hour clock times with 00 : 00 being midnight):
00:00 – 05:00 every hour
05:00 – 09:00 every 15 minutes
09:00 – 16:30 every 30 minutes
16:30 – 18:00 every 15 minutes
18:00 – 00:00 every 30 minutes
Write a complete C program that inputs a time (in 24-hour clock format, e.g. 15:06; see
sample run) and outputs the time of the closest departing train to the time entered. Note
that this train could be departing before the time entered. If the time entered is the same
amount of time between two trains, always choose the later train. Your prompts and output
should match the sample run exactly (using your name instead of mine!).
2 Sample Run

8 O 0 Terminal – tcsh – 8ox24 g”

liberty:~/docs/classes/egre245/projSolns/% gcc proj3.c

liberty:~/docs/classes/egre245/projSolns/% a.out

Project #3 – D. Resler

Enter a 24-hour time: 2:00

Closest train to catch: 2:00

liberty:~/docs/classes/egre245/projSolns/% a.out

Project #3 – D. Resler

Enter a 24-hour time: 13:15

Closest train to catch: 13:30

liberty:~/docs/classes/egre245/projSolns/% a.out

Project #3 – D. Resler

Enter a 24-hour time: 7:18

Closest train to catch: 7:15

liberty:~/docs/classes/egre245/projSolns/% a.out

Project #3 – D. Resler

Enter a 24-hour time: 23:52

Closest train to catch: 00:00

liberty:~/docs/classes/egreZ45/projSolns/% a.out

Project #3 – D. Resler

Enter a 24-hour time: 5:43

Closest train to catch: 5:45

liberty:~/docs/classes/egre245/projSolns/% I

Closest train to catch: 5:45

liberty:~/docs/classes/egre245/projSolns/% I

2 of 2 1

3 Deliverables
You should turn in a stand-alone, complete application program (your source code) contain-
ing a main function. Name your source code file pro jBXXXX . c where XXXX is the last 4
digits of your student id number. For example, if your student id number is V12345678, your
file Will be named pro j 35678.c. Projects this term Will be submitted Via the web using a
link off of the class web page. Be sure to document your code in the manner described in
class.

find the cost of your paper