Advertisement
Guest User

Untitled

a guest
Feb 8th, 2016
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.77 KB | None | 0 0
  1. class  flower{
  2.      
  3.     name;  
  4.     color;
  5.     price;
  6.     static total;
  7.  
  8.     // getPrice(){
  9.     //  return price;
  10.     // }
  11.  
  12.     // getTotal(){
  13.     //  return total;
  14.     // }
  15. }
  16.  
  17. class lily extends flower{
  18.      lily(name, color, price){
  19.         this->name = name;
  20.         this->color = color;
  21.         this->price = price;
  22.         total += price;
  23.     }
  24. }
  25. class dandelion extends flower{
  26.      dandelion(name, color, price){
  27.         this->name = name;
  28.         this->color = color;
  29.         this->price = price;
  30.         total += price;
  31.     }
  32. }
  33. class chamomile extends flower{
  34.     chamomile(name, color, price){
  35.         this->name = name;
  36.         this->color = color;
  37.         this->price = price;
  38.         total += price;
  39.     }
  40. }
  41.  
  42. public class result {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement