/*
 * FoodItem.java    Authors: Koffman & Wolz
 * Represents a food item at a market
 */
public class FoodItem {

  private String description;
  private double size;
  private double price;

  // Methods
  // postcondition: creates a new object with data field
  //   values as specified by the arguments
  public FoodItem(String desc, double aSize, double aP)
  {
     description = desc;
     size = aSize;
     price = aP;
  }

  // postcondition: sets description to the argument value
  public void setDesc(String desc)
  {
     description = desc;
  }

  // postcondition: sets size to the argument value
  public void setSize(double aSize)
  {
     size = aSize;
  }

  // postcondition: sets price to the argument value
  public void setPrice(double aPrice)
  {
     price = aPrice;
  }

  // postcondition: returns the item description 
  public String getDesc() {
     return description;
  }

  // postcondition: returns the item size
  public double getSize() {
     return size;
  }

  // postcondition: returns the item price 
  public double getPrice() {
     return price;
  }

  // postcondition: returns a string representing the item state 
  public String toString() {
     return description + ", size : " + size +
            ", price $" + price;
  }

  // postcondition: calculates and returns the unit pric
  public double calcUnitPrice() {
     return price / size;
  }
}







