Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1.  
  2. /**
  3.  * Write a description of class Pizza here.
  4.  *
  5.  * @author (your name)
  6.  * @version (a version number or a date)
  7.  */
  8. public class Pizza extends DecoratedPizza
  9. {
  10.     // instance variables - replace the example below with your own
  11.     Crust crust = new Crust();
  12.     private double cost;
  13.     private String image;
  14.  
  15.  
  16.     /**
  17.      * Constructor for objects of class Pizza
  18.      */
  19.     public Pizza(DecoratedPizza topping)
  20.     {
  21.         // initialise instance variables
  22.        super(topping);
  23.     }
  24.    
  25.     protected double pizzaCost(){
  26.        
  27.     cost = crust.getPrice();
  28.    
  29.     return cost;    
  30.     }
  31.    
  32.    
  33.     protected String getImage(){
  34.    
  35.     return image;    
  36.     }
  37.    
  38.    
  39.         public String toString(DecoratedPizza topping){
  40.  
  41.         String str = topping + "PO";
  42.         return str;
  43.     }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement