CS 1001 Introduction to Computers D Term, 2000
Assignment 2 Due: Tuesday, April 4, 2000


Purpose

The purpose of this assignment is to practice writing  FORTRAN programs that utilize the IF statements.

Problem

2a  -- Problem 1 on page 182 of text.
2b -- Problem 2 on page 182 of text.

Script and turnin

Again, all homework assignments must be turned in electronically, using the turnin program, which is accessible from any CCC workstation. To submit your program for grading, follow the steps outlined below:
  1. Create a typescript file: A typescript file is a file which contains a transcript of a session at the computer. The program which allows you to create typescript files is called script. You are required to submit all homework with a typescript file that contains a transcript of the homework being compiled and run. To create a typescript file for this assignment type the commands shown after the prompts below:
  2. >script hw2a.script
    Script started, file is hw2a.script
    >f90 hw2a.f
    >a.out
    
    ...the execution of your program...
    
    >exit
    This will cause all the text that appears on the screen between the script and exit commands to be stored in a file called hw2a.script. When you turn in the typescript file, the grader will be able to see that your program compiled and executed correctly.
  3.  Use the turnin program: All homework must be submitted using the turnin program. You may not turn in your program on floppy disk or as a printout. The turnin program copies files to a directory from which they will be printed and graded by the TA. To use turnin to submit a set of files type

  4.  

     

    /cs/bin/turnin submit cs1001 project file1 file2 ... filen

    where project will be the number of the assignment you are turning in (either hw1a, hw2a,hw2b,... or lab1, lab2...) and where file1 through filen are the files you wish to submit. Whenever a file is submitted by using turnin, it is copied to the cs1001 directory and the date and time of the turnin operation are noted in the files. Any attempts to resubmit the same files will overwrite the previously submitted files. If you realize that the program you submitted had errors, you may correct the errors and use turnin again to turn in the corrected program. The old file(s) will be overwritten by the new ones and the date and time of the second turnin will be noted. The grader will see just the last submitted copy. To use turnin for this assignment type:

    /cs/bin/turnin submit cs1001 hw2 hw2a.f90 hw2a.script
    (Note: Do not turn in your executable file, a.out, or turnin will hang.) A message stating that both files were turned in successfully should appear. If no success message appears, ask the instructor or the TA for help. You will be responsible for correctly submitting all your files on time.

    For more information about turnin, see

    http://www.cs.wpi.edu/Help/turnin.html

Grading

This assignment will be graded based on 100 points. Point values will be allocated as follows:
Documentation
(30 points) Proper documentation is a crucial part of any well-written program. Pages 32-33 in your textbook talks about programming style. Your program should begin with an introductory comment that gives a brief description of what the program does. Your name and section number, your wpi login name, and the date should also be included with the introductory comments. Variable names should be meaningful; ``TaxRate'' as opposed to ``tr'', for example. If a variable needs further explanation, it should be commented (where it is declared) to describe its purpose in the program. Main sections of the program should be separated with blank lines and described with comments.
Functionality
(60 points) The program should work correctly on our test data.
Output
(10 points) The program should include an introductory message to the user. The output should be formatted in a manner similar to that shown in the sample execution, with blank lines and white space that make the output easy to read.

Deliverables

Using the turnin program, turn in your Fortran source file and a typescript file showing successful compilation and a sample execution. Your files must be turned in prior to 12:00 noon. on April 4, 2000  to receive full credit. The command you should use to turn in this assignment is:

/cs/bin/turnin submit cs1001 hw2 hw2a.f90 hw2a.script