working on this problem and not sure whats wrong with my program trying to geting to compute an avg after each grade is entered. any ideas or corrections appericated
// Lab08 problem 1 Created by David Warner 2/27/11
#include <iostream>
using namespace std;
int main( )
{
int testscore = 0;
int num_test = 0;
double avg_testscore = 0.0;
double total_test = 0.0;
cout << "Enter test score [-1 to stop]: ";
cin >> testscore;
while (testscore != -1)
{
total_test = total_test + testscore
num_test = (num_test) + 1.0;
cout << "Enter next test score [-1 to stop]: ";
cin >> testscore;
}
avg_testscore = total_test / num_test;
cout << "Number of test taken: " << num_test << endl;
cout << "Total scores entered: " << total_test << endl;
cout << "Average score of people taking test: " << avg_testscore << endl;
basicly im taking the test score then entering the number of test total test is the sum of all scores entered so far and avg score is just that total / number of people taking test