Question: Write a program that takes its input from a file of numbers of type double. The program outputs to the screen the average and standard

 Write a program that takes its input from a file of

Write a program that takes its input from a file of numbers of type double. The program outputs to the screen the average and standard deviation of the numbers in the file. The file contains nothing but numbers of type double separated by blanks and/or line breaks. The standard deviation of numbers n1,n2,n3 and so forth is defined as the square root of the average of the following numbers: (n1a)2,(n2a)2,(n3a)2, and so forth The number a is the average of the numbers n1,n2,n3, and so forth. If this is being done as a class assignment, obtain the file name from your instructor. (Hint: Write your program so that it first reads the entire file and computes the average of all the numbers, and then closes the file, then reopens the and computes the standard deviation.) The template is linked above, the input file name for this question is week4 1.txt. We can use the standard formula for the mean and stand deviation for this data as confirmation of our program: x1=1,x2=2,,x10=10 Average = sum over i of x[i]= =(n+1)/2, which for n=10 =5.5 Standard Deviation = =(1/count)sqrt(sumoveriof(x[i]a)2)=(1/2)sqrt((n+1)(n1)) which for n=10 =2.872281

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 Databases Questions!