package pizza;
/**
*this is a class template for a pizza
* @author Brandon Wegner
*/
public class Pizza {
//declare instance variables always private or protected
private String topping ;
private double size;
private boolean crust;
private double price;
private double gratuity = .015;
/**
* a setter for size
* @param size
*/
public void setSize(double size){
this.size=size;
/**
* a getter for size
* @return
*/
public double getSize(){
return this.size;
}
}
/**
* a setter for topping
* @param topping
*/
public void setTopping(String topping){
this.topping=topping;
/**
* a getter for topping
* @return
*/
public double getTopping(){
return this.topping
}
}
/**
* a setter for crust
* @param crust
*/
public void setCrust(boolean crust){
this.crust=crust;
/**
* a getter for crust
* @return
*/
public boolean getCrust(){
return this.crust
}
}
/**
* a setter for price
* @param price
*/
public void setPricet(boolean pricet){
this.price=price;
/**
* a getter for price
* @return
*/
public boolean getPrice(){
return this.price
}
}
}
Edited by ZekeDragon, 11 February 2011 - 06:08 PM.
Please use [CODE] tags (the # button) when posting code.


Sign In
Create Account

Back to top









