Write a fortran 77 program that can display the score and the average score of 50 student
Wouldn't writing a fortran program be computing? That is not my expertise.
Sure! Here's an example of a Fortran 77 program that can display the scores and the average score of 50 students:
```fortran
PROGRAM StudentScores
INTEGER :: numStudents, score, totalScore, averageScore, i
! Initialize variables
numStudents = 50
totalScore = 0
WRITE(*,*) "Enter the scores of", numStudents, "students:"
DO i = 1, numStudents
READ(*,*) score
totalScore = totalScore + score
END DO
averageScore = totalScore / numStudents
WRITE(*,*) "Scores and average score of", numStudents, "students:"
WRITE(*,*) "----------------"
DO i = 1, numStudents
WRITE(*,*) "Student", i, ":", score
END DO
WRITE(*,*) "----------------"
WRITE(*,*) "Average score:", averageScore
END PROGRAM StudentScores
```
To run this program, you will need a Fortran compiler. Here are the steps to compile and run the program:
1. Save the program code to a file with a `.f` or `.for` extension, such as `student_scores.f`.
2. Open a terminal or command prompt.
3. Navigate to the directory where you saved the program file using the `cd` command.
4. Compile the program using a Fortran compiler. For example, if you have `gfortran` installed, you can use the following command:
```bash
gfortran student_scores.f -o student_scores
```
This will generate an executable file named `student_scores` in the same directory.
5. Run the program by executing the generated executable file:
```bash
./student_scores
```
The program will prompt you to enter the scores of the 50 students. After entering all the scores, it will display the scores and average score of the students.