Fortran FORTRAN PROGRAM FOR MEANS (Beginner)

AI Thread Summary
The discussion centers on learning Fortran, specifically the challenge of calculating various means (arithmetic, root-mean-square, geometric, and harmonic) for a set of numbers. The user has successfully written code for calculating means for three numbers but struggles to extend this to a larger set. They seek assistance in developing a single Fortran program that can compute these means for four specific sets of numbers. Other participants inquire about the user's progress and previous work, suggesting that they may already have the necessary formulas implemented but are facing difficulties with the arithmetic operations involved in processing multiple values.
rk2ray
Messages
7
Reaction score
0
I am learning Fortran and I am able to write code for 3 number means. Now For computing it for set of numbers is not getting in my mind. I am not able to do it.

Writing a single Fortran program that calculates the arithmetic mean, rms (root-mean-square) average, geometric mean, and harmonic mean for a set of numbers. Running the code for the following four sets of numbers.
(a) 4, 4, 4, 4, 4, 4, 4
(b) 4, 3, 4, 5, 4, 3, 5
(c) 4, 1, 4, 7, 4, 1, 7
(d) 1, 2, 3, 4, 5, 6, 7

Thanks for the help.
 
Technology news on Phys.org
Can you post what you have done so far?
 
You've already programmed the formulas. Are you having trouble doing the arithmetic?
 
Dear Peeps I have posted a few questions about programing on this sectio of the PF forum. I want to ask you veterans how you folks learn program in assembly and about computer architecture for the x86 family. In addition to finish learning C, I am also reading the book From bits to Gates to C and Beyond. In the book, it uses the mini LC3 assembly language. I also have books on assembly programming and computer architecture. The few famous ones i have are Computer Organization and...
I have a quick questions. I am going through a book on C programming on my own. Afterwards, I plan to go through something call data structures and algorithms on my own also in C. I also need to learn C++, Matlab and for personal interest Haskell. For the two topic of data structures and algorithms, I understand there are standard ones across all programming languages. After learning it through C, what would be the biggest issue when trying to implement the same data...

Similar threads

Replies
8
Views
4K
Replies
34
Views
3K
Replies
4
Views
1K
Replies
27
Views
3K
Replies
4
Views
2K
Replies
4
Views
2K
Back
Top