Question
Write a C++ program that calculates an average of several integers entered by the user. It first prompts the user to enter the number of
Write a C++ program that calculates an average of several integers entered by the user. It first prompts the user to enter the number of integers she wants to average, then allows the user to enter the integers one by one, then calculates and displays the result as a floating point number. You must use an array to store the integers; use a loop to fill the array; write a separate function called "average()", which will be called from the main function, and to which the array and its size will be passed as two parameters. You will need to use a loop inside the average function, as well as cast an integer into a float to get a floating point result
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