102k views
2 votes
Average of Grades - Write a program that stores the following values in five different variables: 98, 87, 84, 100, 94. The program should first calculate the sum of these grades and store the result in a variable named sum. Then, the program should divide the sum variable by 5 to get the average. Display the results on the screen. The program output should look similar to: The average of the grades is 92.6.

1 Answer

5 votes

Answer:

Not sure what language, but in python a super basic version would be:

val1 = 98

val2 = 87

val3 = 84

val4 = 100

val5 = 94

sum = val1 + val2 + val3 + val4 + val5

avg = sum / 5

print(avg)

Step-by-step explanation:

User Mehul Kabaria
by
5.6k points