Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // DiscountedItem inherits from Item
- public class DiscountedItem extends Item{
- // add an instance variable for the discount
- // Add constructors that call the super constructor
- // Add get/set methods for discount
- public double getDiscount(){
- return 0.0; // return discount here instead of 0
- }
- // Add a toString() method that returns a call to the super toString
- // and then the discount in parentheses using the super.valueToString() method
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement