parcel_class_01.php

<?php

class Parcel extends Box {

     private $_deliveryAddress;
     private $_weight;

     //Constructor
     public function __construct($length, $width, $height, $deliveryAddress, $weight)
     {

          parent::__construct($length, $width, $height);

          $this->_deliveryAddress = $deliveryAddress;
          $this->_weight = $weight;

     }

     //Public method
     public function cost() {

         $volume = $this->volume();

         if ($volume <= 200)
         {
            return 5;
         }
         else
         {
            return 10;
         }

    }

}

?>
Top
RSS
Facebook
Facebook
Google+
Google+
https://www.paulvgibbs.com/learn-php-and-mysql-web-programming/code-samples/chapter-19/parcel_class_01-php