/** a topping for a pizza */
public class Topping {
  /** name of topping. */
  private String name;
  /** price of topping */
  private double price;
  /** default price - a constant value used in this program.
   *  Constants are final since their value cannot be changed,
   *  and they are written all in capitals with an underscore
   *  "_" to separate the words in the name.  You should always
   *  use a meaningful name for a constant variable.
   */
  private static final double DEFAULT_PRICE = 1.25;
  private static final String DEFAULT_TOPPING = "Cheese";
  
  /** 
   * Create a topping with the name n  and price p. 
   */
  public Topping(String n, double p) {
    this.name= n;
    this.price= p;
  }
 /** 
  *  Create a topping of name n with the default price.
  */
  public Topping(String n) {
    this.name = n;
    this.price = DEFAULT_PRICE;
  }
  /**
   * Create a default type topping with the price p.
   */ 
  public Topping(double p) {
    this.name = DEFAULT_TOPPING;
    this.price= p;
  }
   /** 
    * Create a topping that is the default type
    * and price.
    */ 
  
  public Topping() {
    this.name = DEFAULT_TOPPING;
    this.price = DEFAULT_PRICE;
  }
  
  /**
   * change name of topping to name n
   */
  public void setName(String n) {
    this.name = n;
  }
  /** 
   * get name of topping.
   */
  public String getName() {
    return this.name;
  }
  /** 
   * get price of topping.
   */ 
  public double getPrice() {
    return this.price;
  }
  /**
   * set the price of the topping to price p.
   */
  public void setPrice(double p) {
    this.price = p;
  }
  /* returns the topping details in the format:
   * name: toppingName price: toppingPrice
   */
  public String toString(){
    return "name: " + this.name + " price: " + this.price;
  }
}

