java - Why is there a "deadbranch" in my code? -
below code working fine until last if-else. appears i've done wrong boolean variables cangraduate , onprobation. perhaps i'm reassigning them incorrectly in prior if-else statements. deadbranch occurs @ else half of last if-else. package lab5; import java.util.scanner; public class lab5 { public static void main(string[] args) { //creates scanner object scanner scanner = new scanner(system.in); //part ii //creating variables double gpa; int totalcreditstaken; int mathsciencecredits; int liberalartscredits; int electivecredits; boolean cangraduate = true; boolean onprobation = false; //prompts user imput system.out.println("what gpa?"); gpa = scanner.nextdouble(); system.out.println("what's total amount of credits you've taken?"); totalcreditstaken = scanner.nextint(); system.out.println("how many math , science credits have taken?"); mathsciencecre...