Question: This program named Average should use several functions to accept numbers from a user, then find the average of those numbers. Make sure your code
This program named Average should use several functions to accept numbers from a user, then find the average of those numbers.
Make sure your code implements the following functions:
main: Controls the flow of the program
userInput: Accepts nothing. Returns one decimal value of the sum and one integer of the number of items. Accepts numbers from the user until they enter to quit. Adds the numbers together and keeps a count of how many user number entries there are.
average: Accepts a decimal value and an integer in that order Finds the average of the decimal value, using the integer as the number of items. You cannot use the sum function.
userPrint: Void function. Accepts one decimal value and displays the average to two decimals.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
