Question: Please help with consumable.cpp Here is consumable.h #ifndef CONSUMABLE _ H _ INCLUDED #define CONSUMABLE _ H _ INCLUDED #include Item.h / * *

Please help with consumable.cpp
Here is consumable.h
#ifndef CONSUMABLE_H_INCLUDED
#define CONSUMABLE_H_INCLUDED
#include "Item.h"
/**
* This class represents one Consumable Item--as found in most video games.
* This includes food.
*
* Consumable Items must be stackable.
*/
class Consumable : public Item {
private:
protected:
/**
* The effect recieved by using the Item.
*/
std::string effect;
/**
* Number of time this Item can be used.
*/
int uses;
public:
/**
* Default to a Comsumable Item with an empty name
*/
Consumable();
// Big-3
Consumable(const Consumable& src)= default;
~Consumable()= default;
Consumable& operator=(Consumable& rhs)= default;
/**
* Retrieve effect
*/
std::string getEffect() const;
/**
* Set effect
*/
void setEffect(std::string effect);
/**
* Retrieve number of uses
*/
int getNumberOfUses() const;
/**
* Set number of uses
*/
void setNumberOfUses(int u);
/**
* Print the Consumable Item
*/
void display(std::ostream& outs) const override;
/**
* Read Consumable Item attributes from an input stream
*/
void read(std::istream& ins) override;
bool isStackable() const override;
/**
* Clone--i.e., copy--this Consumable Item
*/
Item* clone() const override;
};
//------------------------------------------------------------------------------
inline
std::string Consumable::getEffect() const
{
return this->effect;
}
//------------------------------------------------------------------------------
inline
void Consumable::setEffect(std::string effect)
{
this->effect = effect;
}
//------------------------------------------------------------------------------
inline
int Consumable::getNumberOfUses() const
{
return this->uses;
}
//------------------------------------------------------------------------------
inline
void Consumable::setNumberOfUses(int u)
{
this->uses = u;
}
#endif
Consumable.cpp is the most right image. Please do not use other answers on chegg as they are incorrect
 Please help with consumable.cpp Here is consumable.h #ifndef CONSUMABLE_H_INCLUDED #define CONSUMABLE_H_INCLUDED

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!