Advertisement
advictoriam

Untitled

Mar 5th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.46 KB | None | 0 0
  1. /**
  2.    A quarter with a state theme.
  3. */
  4. public class Quarter extends Coin
  5. {
  6.    String state;
  7.    
  8.    /**
  9.       Constructs a quarter.
  10.       @param aValue the monetary value of the quarter.
  11.       @param aName the name of the quarter
  12.    */
  13.    public Quarter(String _state)
  14.    {
  15.       super(0.25, "Quarter");
  16.       state = _state;
  17.    }
  18.    
  19.    public String getDescription()
  20.    {
  21.       return String.format("Quarter, value=0.25, state=%s", state);
  22.    }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement