1.5.2 If else

Add to your Selection project:


if - else Demo

public class IfElseDemo {
    public static void main(String[] args) {

        int testscore = 6;


        if (testscore >= 50) {
            System.out.println("You pass with a test Score of  = " + testscore);
        } 
        else {
            System.out.println("You pass with a test Score of  = " + testscore);
        }
    }
}
Modify this program so that the test score is entered in a input dialog box


Comments