OOP

 

 Tasks

The key abstractions employed in this program are Item, ItemStack, Inventory Armour, and Consumable.

Your overall task is to complete the Armour and Consumable ADTs.

  1. As an initial step, you will need to complete the Armour and Consumable Default Constructors:
    a. Set the stackable attributei.e., stackable.
    Hint Remember initializer lists?       b.Set the name attributei.e., Item::name. The attribute, name, is a protected data member of Item.
  2. Implement Armour::clone and Consumable::clone.
  3. Implement Armour::read and Consumable::read.
  4. Implement Armour::display and Consumable::display.

You are expected to generate additional input files to test your code. Test your code throughly before submitting your solution.

 

Testing Your Code

I have provided you a set of unit tests. In addition to your normal checks (e.g., running the completed program and performing head-to-head testing) run the unit tests with

make tests

./testNewClasses

You should see:

PASSED -> testDefaultArmourConstructor

PASSED -> testArmourCopyConstructor

PASSED -> testArmourClone

PASSED -> testArmourDisplay

PASSED -> testArmourRead

PASSED -> testDefaultConsumableConstructor

PASSED -> testConsumableCopyConstructor

PASSED -> testConsumableClone

PASSED -> testConsumableDisplay

PASSED -> testConsumableRead

 

n the grade report that you receive, you will see tests numbered 000 through 008.

  1. Test 000 evaluates your implementation of Armour::Armour()
  2. Test 001 evaluates your implementation of Armour::clone()
  3. Test 002 evaluates your implementation of Armour::display
  4. Test 003 evaluates your implementation of Armour::read
  5. Test 004 evaluates your implementation of Consumable::Consumable()
  6. Test 005 evaluates your implementation of Consumable::clone()
  7. Test 006 evaluates your implementation of Consumable::display
  8. Test 007 evaluates your implementation of Consumable::read
  9. Test 008 (System Test) evaluates all both classesi.e., your solution as a wholeincluding output and output formatting.

 

Submitting

Files to Submit:

  • Armour.cppi.e., your version of the Armour ADT.
  • Consumable.cppi.e., your version of the Consumable ADT.