I've been messing around way too long on this one and would like to get more out of my if else statements. All of the code works up until a student has a low GPA and or a low SAT score but happens to be the valedictorian of a huge class. I know its unheard of but my code isn't working correct to me if it doesn't qualify that student.
My first post. Thanks for any suggestions Bryan
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("\n\tStudent Qualifier");
System.out.println("Enter students GPA: ");
double gpa = in.nextDouble();
System.out.println("Enter students SAT score: ");
double sat = in.nextDouble();
System.out.println("\nIf student was valedictorin or salutatorian of a school of 1400 or more, Enter y or n");
String highestHonors = in.next();
in.close();
if (gpa >= 4.0 && sat >= 1100)
studentQualified();
if (gpa >= 3.5 && sat >= 1300)
studentQualified();
if (gpa >= 3.0 && sat >= 1500)
studentQualified();
if (highestHonors == "y")
studentQualified();
else
unQualified();
}
public static void studentQualified() {
System.out.println("Student is qualified");
}
public static void unQualified() {
System.out.println("Student is not qualified");
}
}