Listing 7

    do{
      count = count + 1;
      sum = sum + temp;
      cout << "Enter a grade or -1 to quit." << endl;
      cin >> temp;
    }while(temp != -1.0);

Listing 7