Introduction
This assignment asks you to implement a PriceTag class as well as a PriceTagTester class. The PriceTag should model a simple price tag. The PriceTagTester class should be a complete test driver -- it should excercise all of its functionality.
The PriceTagclass
Please implement a class specification for a class that models aspects of a price tag, as follows:
- It should contain the name of an item, for example, a "Bostich Stapler"
- It should contain the items price in dollars and fractions thereof, for example, 4.52
- It should contain the items stockNumber, for example, "045-223-AXJ"
- All three of these properties should be set at initialization.
- All three of these properties should be individually accessible through methods.
- The price should be changeable, any time.
- The class should have a method, defined as follows:
- int compareTo (Object o)
- This method should return 0, if and only if the two items have the same price. It should return a negative number if and only if the comparing item is less than the item passed as a parameter. It should return a positive number otherise (the comparing item is greater than the item passed as a parameter).
Notes