CSC1110 - Week 11 Exercise
Overview
In this Exercise, you will create an interface and three classes that implement the interface. The interface will be for Buyable objects and the classes will represented object types that you might find in a video game or adventuring rpg. You will also implement parts of a driver that simulates an item buying screen that you might find in a game.
Instructions
Implement the interface and methods shown in the UML diagram given the following details. You must implement a unique class that implements the Buyable interface in addition to the two implementing classes shown in the UML. This custom class should follow the pattern of the two classes shown. See the implementing details below.
Once you have implemented the classes, implement the TODO statement in the driver provided in the GitHub repo, such that you get an output similar to the sample output.

Buyable
- MIN_SELL_PRICE is the minimum cost of any item. No item will have a value() less than this value.
- display(): Prints its value, the name of the item, and it's attribute(s) (e.g., damage, weight, type, etc).
- value(): Value of the item. Should be based on it's attribute(s).
- discount(): Applies a discount to the price based on how many items were purchased.
The price is reduced by 5% for each item purchased. This method returns the new, discounted price.
price -= price * itemsPurchased * discountPerItem;
Weapon
- Sole attribute is the damage amount.
- value() of a weapon is 1.5 times it damage amount.
Ingot
- Possess attributes for type and weight in pounds.
- value() of an ingot is its weight times its price per pound. The price per pound for gold, silver, and any other type is 2, 1.5, and 1 respectively.
Custom Object
- Create your own object type that you would find in a video game or adventuring rpg. This object type should have an attribute(s) that defines a property of the object.
- value() of this object should be based on its attribute(s).
Sample Output
Welcome to my shop, The Hording Adventurer. 1. Price: 15.0 .Weapon with 10 damage. 2. Price: 5.0 Ingot of gold with eight of 2.0. 3. Price: 5.0. Potion of haste. Enter the number for the item you would like to buy: 1 Buying: Price: 15.0 .Weapon with 10 damage. Would you like to buy more (y/n) y 1. Price: 5.0 Ingot of gold with eight of 2.0. 2. Price: 5.0. Potion of haste. Enter the number for the item you would like to buy: 2 Buying: Price: 5.0. Potion of haste. Would you like to buy more (y/n) n Items bought: Price: 15.0 .Weapon with 10 damage. Price: 5.0. Potion of haste. Cost of all items: 20.0 Cost after discount: 18.0
Submission Instructions:
Commit and push your code to your GitHUb repository.