All On Your Own!


#1

I can't seem to finnish the exercize because i don't use enough cases... it said 3. what am i doing wrong here.

    <?php
$myLvl = 33;

    switch ($myLvl){
    case 12;
        echo "RAGE QUIT";
    break;
    
    case 13;
        echo "Push the tempo";
    break;
    
    case 93;
        echo "Clear blue skyes";
    break;
   
    case 23;
        echo "miss monroe";
    break;
   
    default:
        echo "thank you";
    }
?>

#2

You use the wrong syntax:

case 23: // correct
case 23; // incorrect

#3

to bad i wish that worked but and i was at fault there indeed but this didn't help.
It still states "Oops, try again.
Make sure you have three case blocks!"


#4

Did you fix all errors?

If i do it, the Code is correct and let me go to the next exercise.

Check all your cases!

If this dont help refresh site and clear cache or try a other Browser.


#5

Hello and thank you in advance for help

I tried this lesson several different ways with both numbers & text string in quotes
Here's the last attempt. I've checked semi-colons, and tried in a different browser. All to no avail. Can you point out where this is wrong?

$name = "Sam";
 
 switch ($name) {
     case "Sam";
     echo 'Hello Sam';
     break;
     
     case "Juan";
     echo 'Hello Juan';
     break;
     
     case "Zia";
     echo 'Hello Zia';
     break;
     
     default;
         echo 'Who are you? \n';
 }

#6

$name = "Sam";

switch ($name) {
case "Sam"; <------------------------ you have to use ":" in every case statement
echo 'Hello Sam';
break;

 case "Juan";
 echo 'Hello Juan';
 break;

 case "Zia";
 echo 'Hello Zia';
 break;

 default;
     echo 'Who are you? \n';

}