Assignment #6
FORTRAN Programming Assignment due Tuesday, September 14, 2004
Write a program which will get an unspecified number of items from the user at the keyboard. The items should all be integers in the range -99999 to 99999 and should be entered one at a time. The program should store the numbers in two different arrays. One array should hold the positive numbers; the second should hold the negative numbers. The program should count the number of positive numbers, the number of negative numbers, the number of zeros, and the number of erroneous values entered by the user. If the user makes a typing error, the program should print out an error message and continue to get additional values. When there is no more data the program should find the average of the positive numbers and the average of the negative numbers. At the end of the program, all of the data gathered or computed should be printed out with labels identifying it. The values in each array should be printed out separately as a table with 3 values per line (as shown below). The spacing is up to you but the columns should be lined up right-justified.
12 34 56
234 9 123
This program must follow all of the documentation guidelines already discussed in previous assignments or on any of the class webpages. You should name your executable p3FORTRAN.exe In addition it must use each the following FORTRAN features at least once (even if it has to be contrived) and more times if appropriate for good programming style.
arrays
do loops
end =
err =
formatted reads
formatted writes
arithmetic if
computed goto
subroutines
functions
if
If you have questions over the weekend, you may send me e-mail or post your question on the Blackboard bulletin board and I will attempt to respond. Do not send word documents and do not send code for me to debug.