Create an object of BOOK. Input the values in data members of object and then display the data of object. In main () function, also use switch statement to prompt the user for choice of operations either to purchase or sell a book. Sold () function must also check the quantity available to sell
#include <iostream>
using namespace std;
class Book
{
static int _amount;
string _bookName;
string _author;
public:
Book()
{
_amount = 0;
_bookName = "";
_author = "";
}
Sold()const
{
return _amount;
}
};
int main()
{
Book book;
return 0;
}
Comments
Leave a comment