public class Item {

    private static int nextSkuCode = 1000000;	
	private String name; 
	private int sku; // the scanning code
	private double price;

	// Creates an Item with the name n and price p and the 
     // current sku, then increments the sku by 1.
	public Item(String n, double p) {	
		name = n;
		price = p;
		sku = nextSkuCode;
		nextSkuCode++;
	}
	
	// Returns true iff Item i has the same sku as this
     // item.
	public boolean equals(Item i) {
		 return this.sku == i.sku;
	}

     // Puts this item on sale by percentOff percent.
     // Assume that percentOff is in between 0 and 100.
	public void discount(double percentOff) {
		price = price*(1 - (100-percentOff)/100)

	}

	// Returns the name of this Item.
	public String getName() {
		return name;
	}


    // Creates a new item with the name of this item
	// with "II" added to the end of it. The price will
	// be double the price of this Item.
	public Item createNewAndImproved() {
		return new Item(name+"II",2*price);
	}
		
	// Reduces the price of this item by 1 dollar.
	public void dollarOff() {
		price = price - 1;
	}
	
	// Returns a string representation of this object.
	// This representation only includes the name and
	// price of the item.
	public String toString() {
		return name+" $"+price;

	}	

	// Returns a negative integer if this comes before i,
	// a positive integer if this comes after i, and 0 if
	// they are equal. To determine which comes first, 
	// compare prices. The lower price comes first. If the
	// prices are the same, break the tie by sku. If the 
	// skus are the same, 0 is returned.
	public int compareTo(Item i) {
		
		// This one comes first.
		if (this.price < i.price)
			return -1;
			
		// This one comes last.
		else if (this.price > i.price)
			return 1;
			
		// Tie broken by difference in sku.
		else
			return this.sku - i.sku;
	}
	
}
