Question: (C++ Program) I am having a hard time trying to complete this program i need help. 1. You are to implement the Consumables and the

(C++ Program)

I am having a hard time trying to complete this program i need help.

1. You are to implement the Consumables and the Accessories class, create files for each containing any number of consumables and accessories. (make sure they contain all the information needed).

2. All files have _ (underscores) for the spaces. I show how you remove the spaces for the weapons, you should remove the spaces for all of the words. **challenge is placing them back when you write to the file** 3. In the main, have the ability to show all the (weapon / armor / accessories / consumables) depending what the user wants to see. display those items only. 4. When the program exits, save all the items back in their respective file. To know what each item is, you will need to create a variable in Item called whatIsIt which holds a string holding the item type, so if your object is a weapon, it will say weapon. This variable should go between the name and the description. You will need to UPDATE all files, all the classes, the way you infile and outfile in order for the program to work well with this new variable. ** also, make sure you start your files with the number of items in the file, so when you are saving everything back to the file, you need to know how many of those items there are... (maybe sort based on item type?)

(C++ Program) I am having a hard time trying to complete this

program i need help. 1. You are to implement the Consumables and

the Accessories class, create files for each containing any number of consumables

and accessories. (make sure they contain all the information needed). 2. All

files have _ (underscores) for the spaces. I show how you remove

the spaces for the weapons, you should remove the spaces for all

( please show comments and output)

#include #include #include using namespace std; ll This is the base class class Item private string name iwhatlslt goes here string description; double weight; public: iithese two are the constructors, they will be changed once you include the /whatlsit variable. ltem()(name-"NULL", description-"NULL", weight = 0;} Item(string name, string description, double weight) this->name name this->description description; this->weight weight string getName(return name:) void setName string nameXthis->namename) string getDescription0(retun description: double getWeightKreturn weight:) void setWeight(double weight)fthis->weight weight) virtual void display( cout #include #include using namespace std; ll This is the base class class Item private string name iwhatlslt goes here string description; double weight; public: iithese two are the constructors, they will be changed once you include the /whatlsit variable. ltem()(name-"NULL", description-"NULL", weight = 0;} Item(string name, string description, double weight) this->name name this->description description; this->weight weight string getName(return name:) void setName string nameXthis->namename) string getDescription0(retun description: double getWeightKreturn weight:) void setWeight(double weight)fthis->weight weight) virtual void display( cout

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!