Need help with 10/11 of Conditionals

java

#1

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

    char penaltyKick = 'X';

    switch (penaltyKick) {

        case 'L': System.out.println("Messi shoots to the left and scores!");
                            break; 
        case 'R': System.out.println("Messi shoots to the right and misses the goal!");
                            break;
        case 'C': System.out.println("Messi shoots down the center, but the keeper blocks it!");
                            break;
        default:
            System.out.println("Messi is in position...");
    break;
    }
}

}


#2

Could you post a screenshot of your entire web browser so that we can see what you see please?


#3

Hi @umeradam ,

You have this:

char penaltyKick = 'X';

Now, for step 2, you need to change the 'X' to either 'L', 'R', or 'C'.


#4

Hey. Did you solve this?

If not, let's see if I can help:

The only output this program, in its current state, would ever output is "Messi is in position..." Do you see why?


#5

привет, мне нужна помощь .


#6

you need to use either one of the 3 values. 'L', 'R', or 'C'. you should not use all three values


#7

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.