Question 1: If you input the grades of 93, -1, 97 90.. The average should be (93+97+90)/3 = 93.33, but it is displaying the average as 93.00, all the decimals are rounding to .00 ... Why?
Question 2: If I enter 'Y' to calculate the average of the next student & continue the loop, it's including the calculations from the previous students test grades. How do I stop that from happening? I need the NEW average for the NEW set of test grades. I'm very new at loops and I'm a loss! Any tips or hints to lead me in the right direction will be very appreciated!! THANK YOU!
The average should be (93+97+90)/3 = 93.33, but it is displaying the average as 93.00, all the decimals are rounding to .00 ... Why?
Integer division :+)
Question 2: If I enter 'Y' to calculate the average of the next student & continue the loop, it's including the calculations from the previous students test grades. How do I stop that from happening?
Ohhhh ok, I understand. I moved testScore = 0, exAbs = 0, total = 0; inside of my loop to reset. That makes since... Thank You!!!! What about the division though? I have always used fixed << setprecision(2) and it has always rounded correctly. I don't understand why it's not cooperating this time?
OH I had testScore = 0, exAbs = 0, total = 0 stored as an integer. I changed it as a double... That was an oversight. LoL. Thanks for the tips and letting me figure it out!