/*
 * SquirrelSapiens: This class models an advanced Robotic Squirrel.
 */

class SquirrelSapiens {

	// price of one hazelnut (in Martian cents)
	private int hazelnutPrice = 0; 

	// number of hazelnuts currently in reservoir
	private int numHazelnuts = 0;

	// total value of the hazelnuts currently in reservoir (in Martian cents)
	private int totalValue = 0;

	/*
	 * extract: 'numToExtract' hazelnuts are extracted
	 * from the reservoir.
	 */
	public void extract (int numToExtract) {
		numHazelnuts = numHazelnuts - numToExtract;
		totalValue = numHazelnuts * hazelnutPrice;
	}

	/*
	 * pick: pick 'numToPick' hazelnuts off the tree
	 * and add them to the reservoir.
	 */
	public void pick (int numToPick) {
		numHazelnuts = numHazelnuts + numToPick;
		totalValue = numHazelnuts * hazelnutPrice;
	}

	/*
	 * report: print the cost of one hazelnut, the number of hazelnuts
	 *    currently in the reservoir, and the total value of the hazelnuts
	 *    currently in the reservoir.
	 */
	 public void report () {
	 	System.out.println ("Cost of one hazelnut: " + hazelnutPrice +
                            " Martian cents");
	 	System.out.println ("Number of hazelnuts: " + numHazelnuts);
	 	System.out.println ("Total value of hazelnuts: " + totalValue +
                            " Martian cents");
	 }

	/*
	 * setHazelnutPrice: set the price of a hazelnut to 'newPrice'.
	 * newPrice represents the new price of a hazelnut, in Martian cents.
	 */
	public void setHazelnutPrice (int newPrice) {
		hazelnutPrice = newPrice;
		totalValue = numHazelnuts * hazelnutPrice;
	}
}
