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 CS 110 Sections 1&2 - Program 1

Program1


Time's Fun When You're Having Flies - Kermit the Frog

Due Date:
Wednesday 11/13/96, 5:00 pm

Grade:
25% of your final grade.

Text Covered:
Chp. 2,3

Problem Description:
For the first program, you're going to write a clock. It'll have the following features:

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.

What to Hand In:
Hand in your assignment online by copying your FORTRAN source code file "program1.for" and the compiled executable file "program1.exe" to your handin directory.

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.

Gradesheet:
The following gradesheet will be used to grade this assignment. Please take a close look at it to make sure you do everything that is required. Note that you will be graded on correct output for the input values given below, so before handing it in you must run your program with these values and manually check that your program gives the correct results in every case.

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]
   

Copyright © 1996 Jeff Lampert (tick@cs.wisc.edu). Last modified November 4, 1996.