ifElse.java


#1

plzz help me
public class IfElseIf {
public static void main(String[] args) {

	int round=8;

	if (round > 12) {

		System.out.println("The match is over!");

	} else if (round > 0) {

		System.out.println("The match is underway!");

	}	else {

		System.out.println("The boxing match hasn't started yet.");

	}	
}

}


#3

Hmm didnt can see what is wrong
Did you get a Errormessage?!

Here my Code

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

        int round = 6;

        if (round > 12) {

            System.out.println("The match is over!");

        } else if (round > 0) {

            System.out.println("The match is underway!");

        }    else {

            System.out.println("The boxing match hasn't started yet.");

        }    
    }
}

#4

@rydan

Instructions says
1.Set the value of the round variable so that the code in the else if block runs.

His code looks similar to mine and my code worked


#5

ohh okay i havent done this exercise yet. :smile: