6hw3b

_______________________________________________________________________

Using the editor write and save a file xxxxdata.txt which looks like this

78.3

59.5

89.2

72.2

95.3

100.0

This file contains the scores of 6 students in a quiz. ________________________________________________________________

2) Write a C++ program which consists of a main function and a function named stat.

The main function should:

  1. Read the scores from the data file into an array scores[6].
  2. Use the function
  3. void stat ( float scores[], float& xbar, float& x2bar )

    to locate and return the average of the scores and the average of the squares of

    the scores.

  4. Print to the screen xbar and x2bar..