Conditionals exercise 9


#1

Can't figure out the problem here. I get this error (Did you set canDrive equal to the result of the ternary expression? You can use the example to help you.) when I put in this code.

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

    int fuelLevel = 3;

    char canDrive = (fuelLevel>0)?'Y':'N'; 
    System.out.println(canDrive);

}

}


#2

The code checker is happier on this one if you put spaces around each operator.


#3

Thanks! Seemed like a silly error


#6