Results 1 to 10 of 42

Thread: Day 4 - Decision Making - Become PHP Expert in 30 days

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2009
    Posts
    76,596

    Default

    http://php.flashwebhost.com/sherly/discount.php

    Code:
    <?php 
     $over65=true; 
     $price = 3.00; 
     if ($over65) 
     { 
     $discount =.90; 
    echo  "You have received our senior's discount, your price is $" . $price*$discount; 
     } 
     else 
     { 
    echo "Sorry you do not qualify for a discount, your price is $" . $price; 
     } 
     ?>
    Last edited by sherlyk; 05-13-2014 at 07:30 AM.

  2. #2
    Join Date
    Nov 2004
    Location
    India
    Posts
    65

    Default

    http://php.flashwebhost.com/stefin/fish_can_fly.php

    Code:
    <?php
    $fishsCanFly = 'yes';
    if ($fishsCanFly == 'yes') {
    echo 'then we can never have a fish curry' ;
     }
    if ( $fishsCanFly == 'no') {
    echo 'then we can have as much fish as we want' ;
     }

  3. #3
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by stefin View Post
    http://php.flashwebhost.com/stefin/fish_can_fly.php

    Code:
    <?php
    $fishsCanFly = 'yes';
    if ($fishsCanFly == 'yes') {
    echo 'then we can never have a fish curry' ;
     }
    if ( $fishsCanFly == 'no') {
    echo 'then we can have as much fish as we want' ;
     }
    Nice program, fishes love water.
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

  4. #4
    Join Date
    Nov 2004
    Location
    India
    Posts
    65

    Default

    http://php.flashwebhost.com/stefin/if_greater.php

    Code:
    <?php
    $totalScoreRequiredToUnlockTheNextLevel = 8000;
    $playerName = 'stefin';
    $yourScore = 16000;
    if ($yourScore > $totalScoreRequiredToUnlockTheNextLevel) {
    echo 'Congratulations ' . $playerName . ' ! hurrah You Have Cleared The Level your score is' .  $yourScore . ' point' 
    ;  
    }

  5. #5
    Join Date
    Sep 2003
    Posts
    3,040

    Default

    Quote Originally Posted by stefin View Post
    http://php.flashwebhost.com/stefin/if_greater.php

    Code:
    <?php
    $totalScoreRequiredToUnlockTheNextLevel = 8000;
    $playerName = 'stefin';
    $yourScore = 16000;
    if ($yourScore > $totalScoreRequiredToUnlockTheNextLevel) {
    echo 'Congratulations ' . $playerName . ' ! hurrah You Have Cleared The Level your score is' .  $yourScore . ' point' 
    ;  
    }

    You win, dragon eggs are on the way
    Become PHP Expert in 30 days
    FreeMarriage.com - Free Online Matrimonial
    FlashWebHost.com - Professional Web Hosting, Designing.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •