hate to bug you prelude but you seem to understand what im trying to do. now im not asking you to do this for me but you've been great at explaining this to me today. so anyhoo. when i first ran the program it would calculate the mean and display only the first line. now when i added the following code
...it only calculates the mean for the very last set of floating point numbers and displays it. How in the world do i get it to display all the rows 1-2000???Code://verify open was sucessful if(!inFile.fail()) //ifopen did not fail { //read cell a1 through j1 inFile >> cell1 >> cell2 >> cell3 >> cell4 >> cell5 >> cell6 >> cell7 >> cell8 >> cell9 >> cell10; while(!inFile.eof()){ //calculate the mean for ROW and place in mean variable mean = (cell1+cell2+cell3+cell4+cell5+cell6+cell7+cell8+cell9+cell10)/10; inFile >> cell1 >> cell2 >> cell3 >> cell4 >> cell5 >> cell6 >> cell7 >> cell8 >> cell9 >> cell10; } }



LinkBack URL
About LinkBacks


