Use single inheritance to provide inventory tracking for a book object. Create a
ID: 3621579 • Letter: U
Question
Use single inheritance to provide inventory tracking for a book object. Create a subclass BookInventory that holds an int value representing the inventory for the book. In addition to a constructor this class should overload the + and - operators to increase and decrease the inventory and and the displayValues()function. I need help with the addition to constructor overloading the + and - operators to increase and decreasing the inventory and and the displayValues()function.#include<iostream>
using namespace std;
class BookInventory
{
private:
int bookInv;
public:
BookInventory(int invent = 0);
void showInv();
};
BookInventory::BookInventory(int invent)
{
cout << "Inventory has been expanded." << endl;
bookInv = invent;
}
void BookInventory::showInv()
{
cout << "Inventory:" << bookInv << " ";
}
int main()
{
BookInventory book(1);
book.showInv();
system("pause");
return 0;
}