Next: About this document ...
Up: Arithmetic Expressions
Previous: Declarations

Checkoff

When visitors come to dinner Mr. Smith always makes them Danish Apple Cake. For four people this requires the following ingredients:

Write a program that inputs the number of people coming to dinner and then prints the amount of each ingredient required. Round all of your output values down to an integer. (For example, you should print 100.6 as 100.)

To help you get started, we have provided a ``skeleton'' program. See ``cake.f'' in your ``examples'' directory (or view it directly). Don't forget to use ``IMPLICIT NONE'' in your program.

When you are finished, call a TA over to take a look at your program. If your program is correct, the TA will check you off. And be sure to save your program when you are done. You will modify it in the checkoff portion of the next lesson.

Homework Problem 1

Write a program that inputs 7 integers and prints out their arithmetic and geometric means, as real numbers, and then round your results down to the nearest integer. [Hint: Arithmetic mean = average; geometric mean of n positive numbers is .] Your program should print out ``Data Error'' if one of the integers input is negative.

Call the file that contains your program solution1.f. To submit it for grading, use the UNIX Shell window to connect to the directory that contains your program and enter the following command:

handin cs101 problem-1 solution1.f

Some Useful Information

Here is some information that you may find useful as the quarter proceeds:

  1. If you'd like to see a record of all your grades to date, type

    checkgrades cs101
    

    in your Unix Shell window.

  2. If you'd like to see a record of what you've already handed in for a particular problem, type

    handin cs101 problem-1
    

    Of course, you should use a different problem name if you aren't interested in problem one.

  3. If you have any questions when a TA is not available, send electronic mail. The electronic mail addresses of the TAs are available from the Schedule option of the TA menu. You can mail to the entire course staff at once by using the address ``teach-cs101@eng''.

  4. We will try to return your graded homework within a week after the due date.

  5. The overall grading criteria for each problem will be roughly as follows:

    Correctness: 60%. Does your program compute the right results and fulfill all of its requirements?

    Style: 40%. Is your program well commented? Is it indented in a structured way? Does it communicate with the user via input/output in a helpful way? Are meaningful variable names used? You should refer to examples from the lessons and the textbooks, and pay attention to TA feedback, to gain an appreciation for good programming style. The grading in this department will become more exacting as you learn more and the TAs begin to expect more of you.


Next: About this document ...
Up: Arithmetic Expressions
Previous: Declarations

Hamlet Project
hamlet@cs.utah.edu