Question: C++ Create a User class, with a separate interface (printBook.h) and implementation (printBook.cpp), comprised of the following attributes: But with an array of Book this

C++

Create a User class, with a separate interface (printBook.h) and implementation (printBook.cpp), comprised of the following attributes:

But with an array of Book this time! Write a new printAllBooks function which will be useful to display the contents of your library. This function should:

  • Accept two arguments in this order:

    • array books: array of Book objects.

    • int: number of books in the array (Note: this value might be less than the capacity of 50 books)

  • This function does not return anything

  • If the number of books is 0, print No books are stored

  • Otherwise, print Here is a list of books and then each book in a new line using the following statement

cout << books[i].getTitle() << " by "; cout << books[i].getAuthor() << endl;

In the Answer Box below, paste your Book class (both the header and implementation), and your printAllBooks function, not the entire driver program you are using to test your printAllBooks function. As in the previous problems, do not include all the extra headers and #ifndef/#define junk.

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!