Totally new at this and im not sure how to re build my code without the use of arrays or vectors?
how do i properly add a cin.clear or cin.seekg(0) to have my while loop restart and perform the standard deviation calculation.
per Teacher
You are not allowed to write your own functions and, even if you know about them, you are not allowed to
use arrays. You may assume the file contains at least two values and only consists of floating-point
values, whitespace, newline characters, and the end of file character.
As you are not allowed to use arrays, you need to read all the values once to calculate the average then
use that average along with each value to calculate the standard deviation
You don't have to make a second pass to compute the standard deviation. All you must do is compute the sum(xi2) as well as the sum(xi) in the first pass. After that it's just algebra:
sum((xi - xbar)2)
= sum(xi2 - 2*xi*xbar + xbar2)
= sum(xi2) - 2*xbar*sum(xi) + N*xbar2