I'm just learning about switchs, what's wrong with the JOptionPane part of this code, that it won't compile the comments from the previous swith. Thanks.
CODE
AverageScore = ((0.30*Test1)+(0.30*Test2)+(0.40*Final));
if ((AverageScore >= 90.000) && (AverageScore <= 100.000))
{
char LetterGrade = A;
}
if ((AverageScore >= 80.000) && (AverageScore < 90.000))
{
char LetterGrade = B;
}
if ((AverageScore >= 70.000) && (AverageScore < 80.000))
{
char LetterGrade = C;
}
if ((AverageScore >= 60.000) && (AverageScore < 70.000))
{
char LetterGrade = D;
}
if ((AverageScore < 60.000))
{
char LetterGrade = F;
}
switch (LetterGrade) {
case A: comment = "GREAT!"; break;
case B: comment = "Good work."; break;
case C: comment = "Just so-so."; break;
case D: comment = "Better luck next time."; break;
case F: comment = "Better luck next time."; break;
default: comment = "Call DJ, something has gone wrong.";
}
JOptionPane.showMEssageDialog (null, "Test One Score: " + (Test1) "/n"
+ "Test Two Score: " + (Test2) "/n"
+ "Final Exam Score: " + (Final) "/n"
+ "Test Average: " + threeDigits(AverageScore) "/n"
+ comment, "Program 2 by DJ Garrison",
"OOPS",JoptionPane.PLAIN_MESSAGE);