July 25th, 2013, 05:12 AM
Join Date: Jul 2013
Time spent in forums: 22 m 59 sec
Reputation Power: 0
i need to write a program for my project in school can someone help
CMPE 100 – PROJECT
Due date 25 July 16:00
In this project you are expected to develop a program that reads a time from a file, then your program
should compute some tasks defined below. Time definition of the file will be in “hour-min-second”
format (e.g. 14:02:30 or 18:05:02 or 22:12:01 ).
Manually you should create a file named “fileIN.dat”, save it into your working directory and it should
arbitrarily contain a time definition. See following case as an example.
1) First of all, you should define a time structure whose three parts are hour(Number) ,
minute(Number) and second(Number).
2) Second, your program reads from the file “fileIN.dat” defined above and it must convert the content
of the file into a time structure.
3) Define a isAfterNoon function that takes the time argument coming from the file (First task) checks
whether given time is after 12:00:00 or not, if so the function write “It is afternoon”, else “it is not
afternoon” to the file named “fileOUT.dat”
4) Define isBefore function takes two time arguments and checks if first is before second. If so, it
returns true, else returns false. E.g, for the arguments 12:00:07 and 12:30:02 , it should return true.
5) Define diff-time function that takes two time arguments, and it counts how many seconds exists
between the given time arguments. Be carefull ! that you should check which one is before or after. If
you miss this checking your calculation could be negative. Therefore depending on that fact, you
should/maybe swap the arguments first.
– Please provide data definitions, contract and test/check cases !
– All time argument of the functions must be in time structure