Select Page

CSCI 252 Columbus College Making Use of Inheritance Programming Report

Question Description

I’m working on a c++ question and need an explanation to help me learn.

we are going to make an Inventory Item a base class and make it simpler for you to transition into inheritance by creating two new child classes. Make sure to the use the source code I gave you do not use the source code from off the internet there was already a previous tutor that did that and wasted 3 days of our time there are different source codes to complete the task use the one I gave you not the one off the internet . If you do not know what you are doing do not accept the task I am not here to waste your time and I do not need you wasting my time.I am using visual studio 2019

Add while loop,

create classes themselves at least 2

Change it to pure virtual we are storing multiple child types as1 type

Create two new classes named Clothing Item and Food Item. Both should inherit from InventoryItem. Don’t worry about adding any properties just yet, we’ll get to that in the next verse.

Ensure InventoryItem has a pure virtual public method defined to display the details about an InventoryItem.

In ClothingItem and FoodItem, override the display method in InventoryItem class. Ensure the output to the user includes detail indicating if the item is a Clothing or Food item.

When gathering input from the user, add an additional step at the beginning to ask them if their inventory item is a Clothing or Food item. Don’t worry about supporting any other items right now. Force them to select one or the other. Also, feel free to use integers to help here. You can ask the user, Press 1 for Clothing Item or Press 2 for Food item. However, if they enter an invalid option inform them of the error and keep asking until the user selects Clothing or Food item.

(Pay close attention to this people been messing this up as well )

Based-on if the user selected a Clothing or Food item, instantiate the corresponding class and store it into the dynamic array of InventoryItems. You must use the new keyword here. I want to see dynamic allocation of the array and the Clothing or Food Item. Also, this will make your array a dynamic array of InventoryItems and an array of pointers. We call this a double pointer. You will need to declare the double pointer like this InventoryItem **inventoryItems = new InventoryItem*[userSizeInput];

Loop the dynamic array of InventoryItems and call the display method of each item.

Cleanup all memory you’ve allocated. loop the dynamic array and destroy each array item first. Then once the loop is finished, destroy the dynamic array.

Ensure you use meaningful names and that your code is pretty formatted. Feel free to use any of the three methods to implementing classes. For this, I would suggest 4 files. One file for the InventoryItem class. One file for the ClothingItem class. One file for the FoodItem class. One file for the main method. Feel free to implement the classes inside or outside of the class definition, which ever is easier for you I am using visual studio 2019 I am on a budget and almost out of money due to study pool and I have had some tutors that I have had bad expierence with all together

"Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you "A" results."

Order Solution Now