Switch Statement: set char variable penaltyKick value to L, R, or C


#1

Can't figure out how to do this.


#2

Show me what you have.


#3

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

    **char penaltyKick = 'L' 'R' 'C';**

    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...");

#4

If I am not mistaken this is Java and you posted it in the python section.

You would have better luck over there.


#5

Oh ok my bad. thank you.