I am having problems with an if statement error. Here's the code:
if (!firstGrade.matches("A+|A|A-|B+|B|B-|C+|C|C-|D+|D|D-|F") || !firstHonors.matches("n|h|ap")) {
System.out.println("Invalid");
System.exit(1);
}
The if statement is checking if firstGrade is not equal to a bunch of values, and if firstHonors is not equal to n, h, and ap. There is no problems wit the second part, it is only the firstGrade check that is causing problems.
The problem occurs when I try to enter a value with a plus sign (A+, B+, C+ etc.), it finds it invalid and exits the program. However, according to the code this should not be the case.