#include using namespace std; int main () { int count = 0; double grade; double total = 0.0; cout << "Enter first grade (-1 to exit): "; cin >> grade; // repeat until a negative grade stops input (sentinel value) while (grade >= 0) { count = count + 1; // count the grade total = total + grade; // add the grade to the total cout << "count is now " << count << endl; cout << "running total is " << total << endl; cout << "Enter next grade (-1 to exit): "; cin >> grade; } cout << "Number of grades = " << count << "\n"; cout << "Total = " << total << endl; cout << "Average = " << total / count << endl; return 0; }