Question: Write C++ program that will prompt for and read in n floating point values and then calculate and display the average of the values and

Write C++ programthat will prompt for and read innfloating point values and then calculate and display the average of the values and the associatedvarianceof the values. First, the program should prompt for and read the number of values to be read in,n. Then it will prompt for and read in thenvalues and then calculate and display the average and the variance of the values.

Here is the definition ofvariance: If we denote thenvalues as,and denote the average of thenvalues, then thevariance=

Requirements and notes:

  • You can assume the user will enter a positive integer fornand floating point numbers for the numbers.
  • You may assume thatnis no more than 100.
  • Do not assume that the user knows the value of the average in advance - your program needs to calculate the average.
  • Your program can ask the user to enter the floating point values only once.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!