Break the Bookdata Class Into Two Classes/Create the SoldBook Class

Poll

Currently the BookData class contains all the data about a book in the stores inventory.
Now you will break the class into two classes: one that is base class containing on general
data about a book, and another that is a derived class containing data about a book in
inventory.
First simplify the BookData class so it contains only the general data about a book.
Specifically, modify the BookData class so it contains only the following member variables
and member functions:
Member Variables:
boookTitle
isbn
author
publisher
Member Functions:
setTitle
setISBN
setAuthor
setPub
Next you will create a new class named InventoryBook. This class will be derived from the
BookData class, and will hold inventory-related data about a book. Specifically, this class will
contains the following member variables and member function, which were removed from
the original BookData class:
Page 2 of 3

Member Variables:
dateAdded
qtyOnHand
wholesale
retail

Member Function:
setDateAdded
SetQty
setWholeSale
setRetail
isEmpty
removeBook

2. Create the soldBook Class:
Create a class named soldBook, which is derived from the InventoryBook Class. Its purpose is
to represent a book that has been sold to a customer and perform the necessary calculations
for the sale of a book. It should have the following members.
Member Variables:
taxRate
qtySold
tax
subtotal
total
You should determine the accessors, mutators, and other member functions needed in this
class.
The Cashier functions should ask the user how many titles the customers are purchasing. It
should then dynamically allocate an array of SoldBook objects large enough for that many
titles. The function will use the array of SoldBook objects to compute the necessary
information for a customer sale. The function will then display the simulated sales slip on the
screen


Attachment
0

Leave an answer