help!!!repeated scentences error!!!

the problem is this..........
the sample output should be

Code:

Enter a grade (A-F):A
Enter a grade (A-F):B
Enter a grade (A-F):A
Enter a grade (A-F):D
Enter a grade (A-F):C
Enter a grade (A-F):D
Enter a grade (A-F):D
Enter a grade (A-F):E
Enter a grade (A-F):C
Enter a grade (A-F):F
number of credit:5
number of pass:9
number of fail:1

BUT.....
it shows up like this...

Code:

Enter a grade (A-F):A
Enter a grade (A-F):
Enter a grade (A-F):
A
Enter a grade (A-F):
Enter a grade (A-F):
A
Enter a grade (A-F):
Enter a grade (A-F):
A
Enter a grade (A-F):
Enter a grade (A-F):
A
Enter a grade (A-F):
Enter a grade (A-F):
A
number of credit:5
number of pass:0
number of fail:0