public class Purse {
  // some useful constants
  public final double NICKEL_VALUE = 0.05;
  public final double DIME_VALUE = 0.1;
  public final double QUARTER_VALUE = 0.25;
  
  // instance fields
  private int myNickels, myDimes, myQuarters;
  
  // Constructor
  // Constructs an empty purse
  public Purse() {
    
  }
  
  // Methods
  // toString method
  public String toString() {
    return "a Purse object with " + 
      myNickels + " nickels, " + 
      myDimes + " dimes and " +
      myQuarters + " quarters";
  }
  
  // Add nickels to the purse
  // count - the number of nickels to add
  public void addNickels(int count) {
    myNickels += count;
  }
  
  // Add dimes to the purse
  // count - the number of dimes to add
  public void addDimes(int count) {
    myDimes += count;
  }
  
  // Add quarters to the purse
  // count - the number of quarters to add
  public void addQuarters(int count) {
    myQuarters += count;
  }
  
  // calculate the total value of the coins in the purse
  // return the sum of all coin values
  public double calculateTotal() {
    double total =
      myNickels*NICKEL_VALUE +
      myDimes*DIME_VALUE +
      myQuarters*QUARTER_VALUE;
    return total;
  }
}