Request and read an input value
Then the code in the body of the loop in Listing 7 requests and reads an input value from the user.
If the user enters -1
If the user enters a value of -1 during the first iteration, the loop will terminate immediately leaving the value of the counter and the value of the sum both at zero.
If the user doesn't enter -1
If the user enters a value other than -1, the loop will not terminate.
Control will go back to the top of the loop in Listing 7 where the grade counter will be incremented and the value of the grade will be added to the sum.