if statements for multiple variables
I need to make a new method to determine letter grades from data previously entered in the main method.
The way of entering was:
and so forth.
System.out.println("Enter the first test score: ");
score1 = keyboard.nextInt();
System.out.println("Enter the second test score: ");
score2 = keyboard.nextInt();
How can I make this new method show the grade? Normally, I'd do something like this:
BUT I have to keep the scores as score1, score2, etc. because later on I calculate the average of the 5 scores they enter.
if (score >= 90)
result = 'A';
else if (score >=80)
result = 'B';
else if (score >= 70)
result = 'C';
else if (score >= 60)
result = 'D';
result = 'F';
How do I make it calculate the grade, and how do I put it back in the main method so it displays the result from the calculateGrade method?