Error while nothing is wrong 3/4


#1

I get this error:

Oops, try again. Did you accidentally change the condition in your if statement? It looks like your code didn't print 'You get a 5% discount!'

while it actually does print You get a 5% discount!





<?php
$items = 8;

    if($items < 5) {
      echo "You get a 10% discount!";
    }

    else { echo "you get a 5% discount!";
    }
  ?>
</p>



#2

you should be You

Like in the Errormessage (Oops, try again. Did you accidentally change the condition in your if statement? It looks like your code didn't print 'You get a 5% discount!')


#3

It happens to me the same and the code is well, somebody fix this?


#4

@laisondecalas

Show your code please.

Your code is checked during large and small letters are also considered. So if you will be written instead of You that's just a mistake. And there is nothing to fix from codeacademy.


#5

Help please...

<?php
$items = 3;

    if($items > 5) {
      echo " You get a 10% discount!" ;
    }
    else {
       echo "You get 5% discount!" ;
    }
  ?>

Oops, try again. Did you set your else statement to echo or print 'You get a 5% discount!' ? Don't forget your semicolon at the end!


#6

You miss the "a"

echo "You get a 5% discount!";

not

echo "You get 5% discount!";

#7

your 'Y' in "you" is small.


#9
<?php
  $items = 8    // Set this to a number greater than 5!
  
  if( $items > 5 ) { ;
    echo "You get a 10% discount!";
  }
?>
Oops, try again.
Make sure to edit the condition line 9 so that it is true.

What's wrong here?


#10

It must be:

<html>
  <head>
  </head>
  <body>
    <p>
      <?php
        $items = 3;
        
        if($items > 5) {
          echo "You get a 10% discount!";
        }
        else {
          echo "You get a 5% discount!";
        }
      ?>
    </p>
  </body>
</html>

#11

I'm getting the same problem, my students will not enjoy this or be able to use the lessons if this continues. Lesson 3, Conditions and Control is reporting an error even if I copy and paste the help script. I cannot move past. Here is my code:

 $items = 4;

if($items > 5) {
  echo "You get a 10% discount!";
}
else {
  echo "You get a 5% discount!";
}

Here is the message: Oops, try again. Did you accidentally change the condition in your if statement? It looks like your code didn't print 'You get a 5% discount!'


#12

I have the same problem. I think the problem is whatever code academy is using to interpret your code. It sucks they need to either fix or scrap it.


#13

I have the same fuckin problem without any respond i am going crazy