FORTRAN assignment #2

assigned: September 2, 2004

due: at start of class September 7, 2004

 

Write a FORTRAN program which

·         describes itself to the user;

·         calls a subroutine (GET3) to obtain 3 numbers from the keyboard;

·         calls a subroutine (PRIN3) to print out  3 numbers;

·         calls another subroutine (SORT3) to  sort the numbers  into descending order. 

·         Your SORT3 subroutine should call another subroutine (SWAP2) to swap out of order  numbers.

·         Finally your program should call PRIN3 again to print out the numbers in descending order.

·          Do not  print the numbers in the sort or swap subroutines.    

·         The data should be integer data  all 3 integers should be on the same line.

·          Use I5 for the input format. 

·         Your data does not have to be a 5-digit integer but you should expect each data item to be right justified in a 5-column field (what happens if it isn’t?). 

 

Deliverables:

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

        Programmer: Elizabeth Adams

  Course: CS 430 FALL 2004

  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.