00:01
In this problem, we're asked to read a bunch of exam scores, a bunch of numerical exam scores, and then from there calculate how many fs, d, cs, bs, and a's we have, and then at the end to return that information to the user.
00:19
So to begin, i've created a new scanner variable.
00:23
I've just called it in, and this is because we're going to be getting user inputs.
00:28
We need a scanner variable.
00:30
Then i also initialized the variable score.
00:34
It's an int.
00:34
I just said equal to zero.
00:36
This variable we're going to be changing every time the user enters a new score, it's kind of like a temporary variable in that sense.
00:46
And then i also initialized f, d, c, b, and a integer variables because we're going to be calculating how many of each of these letter grades that we are receiving.
01:02
So in this while loop here is where we get all the user input, and we continue looping through as long as score is greater than or equal to zero.
01:13
Why are we doing this? well, in the problem, it states that if the user enters a negative value for score, then that signifies or should signify to the program that the loop ends.
01:24
Therefore, that's why we have this conditional here.
01:28
We keep going through the while loop as long as they haven't entered that negative value or scores greater than equal to zero.
01:36
So we prompt the user to go ahead and enter a score...