next up previous
Next: About this document ...

ESC 251 HW 14 Due: Oct. 6

Remember that all counting variables need to be integers.

For this homework, you will need to make use of input/output redirection.

1)
(3 pts) Write an F90 program that will compute the average of the positive double precision values that are given in the data file hw14a.in (this file includes a negative value at the end to terminate input). Right click on the data file name to save it to your computer. How many numbers are in the file?
2)
(1 pts) Write an F90 program that will read in the data from the data file hw14b.in and print the values to the screen. Be sure to match the data type you are reading to the data type in the file.
3)
(4 pts) Write an F90 program that will determine the geometric mean of a set of user input positive integers. Test your program using the values 3,4,8,2,12,9,5. Recall that the geometric mean is defined to be

\begin{displaymath}\sqrt[n]{x_1 \cdot x_2 \cdots x_n}.\end{displaymath}

This problem is an accumulation operation, but here you are accumulating a product and not a sum.




next up previous
Next: About this document ...
2017-10-04