Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions