// Arup Guha
// 12/5/2015
// Class for Junior Knights assignment: Grocery Store

public class item {

	private String name;
	private double cost;

	public item(String myName, double myCost) {
		name = myName;
		cost = myCost;
	}

	// Applies a discount of perc percentage to this item.
	public void discount(int perc) {
		cost = (100-perc)/100.0*cost;
	}

	// Returns a string representation of this item.
	public String toString() {
		return name + ": $" + cost;
	}

	// Returns the name of this item.
	public String getName() {
		return name;
	}

	// Returns the cost of this item.
	public double getCost() {
		return cost;
	}
}