My assignment for intro to CS class was to make a program that a user could enter a letter grade into and then to create a histogram using an array with another class. In the program Z closes the program and it counts mistakes as well. I realize now that I should have just written a command to make the users letter capital but whats done is done and it like won't matter for this program. I believe what shown below works, but I need some help making a second class and array. If someone could help I would greatly appreciate it.
public static void main (String[] args) {
Scanner scan = new Scanner (System.in);
int aCount = 0;
int bCount = 0;
int cCount = 0;
int dCount = 0;
int fCount = 0;
int mCount = 0;
int Tscore = -1;
int count = 0;
String score;
while (Tscore == -1)
{ count ++;
System.out.print("Pleases Enter a Letter Grade or Z to quit");
score = scan.next() ;
if (score.equals("a") || score.equals("A")) {
aCount++ ;
} else if (score.equals("b") || score.equals("B")) {
bCount++ ;
} else if (score.equals("c") || score.equals("C")) {
cCount++ ;
} else if (score.equals("d") || score.equals("D")) {
dCount++ ;
} else if (score.equals("f") || score.equals("F")) {
fCount++ ;
} else if (score != "a" && score != "A" && score != "b" && score != "B" && score != "c" && score != "C" && score != "d" && score != "D" && score != "f" && score != "F" && score != "z" && score != "Z") {
mCount++ ;
} else if (score.equals("z") || score.equals("Z")) {
Tscore++ ;
}