Question
To get the average of series of values, you add the values up and then divide the sum by the number of values. Write a
To get the average of series of values, you add the values up and then divide the sum by the number of values. Write a program that stores the following values in five different variables: 28, 32, 37, 24, and 33. The program should first calculate the sum of these five variables and store the result in a separate variable named sum. Then the program should divide the sum variable by 5 to get the average. Display the average to the screen. Design your output anyway you want.
Tip: Use double data type for all variables in this program. Output= 30.8
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started