first of all, make your posted code more readable by using
"code" and "/code" (replace my double quote marks w/ square brackets)
markers to get the proper formatting.
First problem I see in your code is that you initialize grade as 0 and never read into it (from input) any other value.
When you read a grade, you count that as one more student. You never actually record the grade itself.
Create a test input of about 4 grades.
Now write down the names of all your variables on a sheet of scratch paper. These are column headers.
Run through your program using the test input and write down under each
variable (in its column) the values that variable takes on as you run through the program. If it helps you can write down the changes taking place row by row (number the rows in your code and below your columns - graph papaer is good for this).
Are things working the way you planned?
[ November 20, 2004: Message edited by: Elouise Kivineva ]