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

Weapon

Ingot

Custom Object

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.