FORTRAN programming assignment 1

Assigned:  August 31, 2004

Due:  September 2, 2004

 

Deliverables:

  1. Printout of the program
  2. diskette with source and executable on it
  3. Printout, and diskette must be in folder
  4. Folder must be labeled with:  Student Name, Professor Name (Dr. Adams), date (Fall 2004) and course number  in 20 pt font or larger
  5. Program must have required heading  (see sample below) – as comments

        Programmer: Elizabeth Adams

  Course: CS 355 Spring 2003

  Date: February 5, 2003

  Language: FORTRAN (using only features present in early FORTRAN)

  Compiler: Lahey FORTRAN 95

  Environmment: Windows NT

  Source Filename: EndErr.FOR

  Executable Filename: EndErr.exe

  1. Comments must describe:

Purpose of program

Program input

Program output

  1. Program should have comments about the language interspersed so that if you need to re-learn FORTRAN you can look at your programs from this course and you will have a good review.

 

Write a program that will read three numbers  (A, B, and H) which appear on a single input line in F10.2 format.  These are to represent the lengths of the two parallel sides and height respectively or a trapezoid, and are to be used to compute the area of the trapezoid using the formula    area equals ½ the sum of the sides times the height.  The program should print oput  A,B, H, and the area and then return to read three new values of A,B, and H.  

 

Possible Questions:

·        How many set of values will there be?

o       not specified

·        How do we know when to stop then?

o       let’s talk about it