Friday, April 25, 2014

Conditionals and Control Flow - 3/4 - codeacademy.com

Instructions:  Under your if statement on line 12, write an else statement to capture the people who are only buying 5 items or fewer. In their case, useecho to output "You get a 5% discount!"



<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>

No comments:

Post a Comment