Ok, I have worked on this for approximately 5 hours, and I have not received the output I wanted, not even close. The program is pretty simple, its not long at all, here are the specs.
She wants us to use a While loop only the by the way.
//SPEC SHEET:
//1. Declare a variable to hold a counter (that will count the number of
// values read from the file)
//2. (NO stop value is needed. The loop stops when all values have been read
// from the file)
//3. Declare one variable to be used (And re-used) for the reading of each
// value from the file.
//4. Declare variables for the variance, the mean, and the standard deviation
//5. Declare variable for two total sums: sum of values and sum of each value
// squared
//6. Read the values from the file one at a time, and update each of the 2
// totals
//7. use both totals to calculate the variance
//8. Use the first total (sum of values) to calculate the mean (mean = total
// / number of values)
//9. Display the variance, standard deviation and mean
I am having trouble, specifically with number 1, 6, and 7. I am positive that I have a mistake in at least one of those. Number 6, is one that I dont even know how to do.
Here is the first link to the program, which also contains the specs at the bottom.
http://ideone.com/369X6O
Here is the link to the file which I am reading from, and it also displays what the specific output of the program should look like at the bottom. (My professor provides us with these to help us.) A few numbers may also be in different colors, but pay no mind to it.
http://ideone.com/kZ6g77