Listing 4

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

Listing 4