okay, so i'm just learning to program, and in class, we're working with arrays. however, i'm having a hard time with them in general, and now i'm having a weird program issue.
here is the first part of the assignment.
Write a
Java program that does the following:
The file [scoreA] contains a sequence of floating-point numbers, each 0–100, representing how students fared in a class. There are no more than 100 grades in the file. The sentinel that signals the end of the values is -999.
1. Read the scores into an array.
2. Count those scores in “bins”, representing letter grades (A: ≥90, B: ≥80, C: ≥70, D: ≥60, F: <60).
3. Print how many students received each grade, e.g.
A: 4
B: 6
C: 5
D: 1
F: 0
so i wrote it and ran it with a file containing the following: 70.5 49.5 66.5 77 1 86 96 76.5 70.5 1 73.1 73.5 87 87.5 80 5 26.5 10 41 74 95 2.5 13 78.5 66 70 99 77 94.5 73.5 -999 (in that order). it reads and counts everything just fine except for the C grades. in the file, the actual count is A: 4, B: 4, C: 11, D: 2, F: 9. no matter what i do, it always tells me there are only 10 C grades. i must be doing something wrong, but i don't know what. here's the code.
i am a little baby programmer, and arrays are probably the most complex concept as i can understand (barely). can anyone tell me what i'm doing wrong?