Initialize counter and accumulator and perform a priming read
The function in Listing 3 begins by setting the grade counter and the grade accumulator to zero.
Perform a priming read
Then the program instructs the user to either enter a grade, or to enter a -1 to quit.
Then it reads the input provided by the user.
(This initial input ahead of the loop that follows is commonly called a priming read.
This terminology is taken from the idea of priming a water pump to cause it to start pumping water.
If you don't know what it means to prime a pump, don't worry about it. Understanding water pumps isn't critical to understanding this program.)