//An enumeration type to represent US coins public enum US_Coin { PENNY(1), NICKLE(5), DIME(10), QUARTER(25), HALF_DOLLAR(50), DOLLAR(100); //Instance Variable private int value; //The cents value of this US_Coin //Constructor private US_Coin(int value) { this.value = value; } //Accessor //Returns the cents value of this US_Coin public int getValue() { return this.value; } //Override //Returns a printable image of this US_Coin public String toString() { if (this == DOLLAR) return "$1"; return this.value + "c."; } }