Question: Using C++ , the goal is to dynamically create an array of Books in BookStore class is dynamically allocated and allows the user to delete

Using C++ , the goal is to dynamically create an array of Books in BookStore class is dynamically allocated and allows the user to delete Books.  Using C++ , the goal is to dynamically create an array
of Books in BookStore class is dynamically allocated and allows the user
to delete Books. Implementation This lab assignment will give you further opportunities

Implementation This lab assignment will give you further opportunities to practice writing classes and using dynamic memory allocation. Your BookStore constructors and destructor will need to be modified so that there are no memory leaks or double frees. You need to change the class BookStore so the array of books is dynamically allocated at class construction time. A new parameter will be added to the BookStore constructor to specify the number of elements of the array. Once the array is created, there is no provision in the design to resize it. The type of this array will now be Book* (dynamic array of pointers to Book). As before, the elements of this array will be dynamically al located when they are added to the array, and once the array fills up, no more books can be added. An additional method will be added to the BookStore class to allow deletion of a book by position. Once again, the files you are going to need are bookstoremain.cpp contains your main function (modify it to allow remove book) book.h book.cpp bookstore.h contains the Book class declaration (leave as is) contains the Book class method definitions (leave as is) contains the BookStore class declaration (modify) contains the BookStore class method definitions (modify) -bookstore.cpp The following table explains each of the methods that you will need to implement Class Access Member Description Private Privateauthors Name of the book Array of string, names of the authors. Maximum Private Private Private quantity sbn authorCount ISBN of the book Number of authors actually in the Represents how many copies of this book are available Constructor takes in the ISBN, the name and Public Book( const string& isbn,quantity of the book const string& nane, size t tit Public Book ( Constructor takes in the ISBN, the name, the const string& isbn,author (in case there is only one) and quantity of const string& nane, the book const string& aut, size t Book tit Public Public AddAuthor(const string&)Adds an author to the author array, only if it Book (const Book&) bool fits". In case it does not fit in the array, it returns returns true otherwise Public ToString): string Public Write(ostream): void of the book Returns a Writes the book to the output stream in the parameter. It changes all spaces to to facilitate reading the file later Reads a book from an input stream, the fields are Public Read (istream&): void ated However, the name of the

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!