Question 1 Write a program to prompt the user for eight (8) float values, and store the data in the float array all in the main() function. The program will calculate the average using the average() function, which accepts the relevant input parameters, and outputs the result to the terminal screen. Example, Enter 8 float values: 1 2 3 4 5 6 7 8 Average 4.50 = Enter 8 float values: 4.6 5.3 1.7 8.3 2.2 5.5 6.2 4.7 Average 4.81

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section10.4: Passing Addresses
Problem 1E
icon
Related questions
Question
Question 1
Write a program to prompt the user for eight (8) float values, and store the data in the float
array all in the main() function. The program will calculate the average using the average()
function, which accepts the relevant input parameters, and outputs the result to the
terminal screen.
Example,
Enter 8 float values: 1 2 3 4 5 6 7 8
Average 4.50
Enter 8 float values: 4.6 5.3 1.7 8.3 2.2 5.5 6.2 4.7
Average 4.81
Transcribed Image Text:Question 1 Write a program to prompt the user for eight (8) float values, and store the data in the float array all in the main() function. The program will calculate the average using the average() function, which accepts the relevant input parameters, and outputs the result to the terminal screen. Example, Enter 8 float values: 1 2 3 4 5 6 7 8 Average 4.50 Enter 8 float values: 4.6 5.3 1.7 8.3 2.2 5.5 6.2 4.7 Average 4.81
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr