Date: Mon, 11 Nov 1996 17:18:46 GMT Server: NCSA/1.5 Content-type: text/html Last-modified: Mon, 11 Nov 1996 17:14:43 GMT Content-length: 4572
This is not simply a case of addition, because you need to keep in mind the following rules for clocks:
So you're going to have to handle
Try doing out some examples on paper before you start writing the program. It will help you quite a bit. Give yourself some sample times and notice how to solve them. Hint: The MOD statement may help you.
Program things in steps. First, program in just reading both sets of hours and minutes. Once you've complied and run that program, and it runs fine, then go on to the next step; Write the lines that deal with reporting an error if you enter a bad number of hours. Once that's working okay, then write the code for adding the hours and printing out the response.
Your files are timestamped with the current time when you copy them to your handin directory. This will be used to check they were handed in on time or whether late day penalties apply. Important - Make sure you copy the correct versions of your program files because these are what will be graded.
You also have to hand in a printed copy of your FORTRAN source code file.
Correct Output [18] time = 10 hr, 20 min, add 1 hr, 5 min [3] time = 9 hr, 7 min, add 4 hr, 6 min [3] time = 8 hr, 27 min, add 2 hr, 47 min [3] time = 11 hr, 47 min, add 1 hr, 17 min [3] time = 12 hr, 59 min, add 12hr, 59 min [3] time = 12 hr, 18 min, add 1 hr, 65 min [3] User Interface [8] Useful prompts for inputting times [4] Meaningful display of final time [4] Implementation [18] Correct implementation of formulas [7] Correct use of FORTRAN statements [7] Meaningful variable names [2] Indenting and neatness [2] Documentation [6] Program description [3] Variable definitions and section comments [3] ____________________________________________________________________ Total (25%) [50]