Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Write a description of class Pizza here.
- *
- * @author (your name)
- * @version (a version number or a date)
- */
- public class Pizza extends DecoratedPizza
- {
- // instance variables - replace the example below with your own
- Crust crust = new Crust();
- private double cost;
- private String image;
- /**
- * Constructor for objects of class Pizza
- */
- public Pizza(DecoratedPizza topping)
- {
- // initialise instance variables
- super(topping);
- }
- protected double pizzaCost(){
- cost = crust.getPrice();
- return cost;
- }
- protected String getImage(){
- return image;
- }
- public String toString(DecoratedPizza topping){
- String str = topping + "PO";
- return str;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement