Question: CODE IN C++ A book normally has attributes like a title, number of pages, and a genre (Horror, or Sci-Fic). You own 3 horror books
CODE IN C++
A book normally has attributes like a title, number of pages, and a genre (Horror, or Sci-Fic). You own 3 horror books and 5 sci-fi books. You decided to place a bookshelf in your room where it will hold your book collection. Your bookshelf can hold a maximum of 20 books, no more. Given the description above, please do the following: o Create a Book class with its attributes, getters/setters functions. Optionally, you may include any suitable functions. o Create Book_Shelf class that is an array of objects for class books with the following methods:
o int CountBooksByGenre(string genre).This function counts the number of books by a given genre.
o int CountTotalBooks(). This function counts how many Books the Bookshelf has. o int CountRemainingSlots(). This function counts the number of free slots at the Bookshelf given that the maximum Bookshelf slots will be 20.
o Test your code from your main function to create the objects for the classes, and to test the methods of the Bookshelf class and to display the results
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
