This is the first iteration on the development of a textbook warehouse inventory management system. This iteration requires a minimum of two user-defined classes. A Book class, with the required interfaces shown below, is used to represent each book in the warehouse. Each is required to have the following attributes: title, one or more authors (no more than 20), publisher, year of publication, cover type (hard/paperback), price, ISBN, and number of available copies. The Book class uses its overloaded stream extraction operator (>>) to retrieve its attributes from the provided database. The Book class also uses its overloaded stream insertion operator (<<) to output the values of its data members. A Warehouse class, with the required interfaces shown below, is a class for storing the list of available books in stock. The Warehouse class uses its overloaded stream extraction operator (>>) to retrieve all the books from the provided database and it uses its overloaded stream insertion operator (<<) to output all the books read in. Since this is a small warehouse, it can only store up to 512 book titles. After retrieving the list of available books from the database, the Warehouse will sort the book lists in ascending order using each book’s ISBN. The Warehouse has a ‘find’method that allows the user to search a book’s record using the ISBN. The program takes two inputs from the command line: a database file and a search list. The database file stores records of all the books in the warehouse. The search list contains the list of ISBN to be searched.

Book.h–contains the Book class declaration.
Book.cpp–contains the Book class implementation.
Warehouse.h–contains the Warehouse class declaration.
Warehouse.cpp–contains the Warehouse class implementation
proj01.cpp–contains the main function and any global helper functions.

The program is required to output the sorted list of books records and the result of each search operation.

Solution PreviewSolution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references. Students may use these solutions for personal skill-building and practice. Unethical use is strictly forbidden.

#include "Book.h"
#include <iostream>
#include <string>
#include <cstdlib>
using namespace std;
Book::Book() {

Book::~Book() {

string Book::getISBN() const {
    return isbn_;

ostream& operator<<(ostream& os, const Book& b) {

    os << "Title: " << b.title_ << "\n";
    // output authors in the array
    for (int i = 0; i < b.authorCount_; i++) {
       os << "Author: " << b.authors_[i] << "\n";
    os << "Publisher: " << b.publisher_ << "\n";
    os << "Year: " << b.yearPublish_ << "\n";
    if (b.hardCover_) {
       os << "Cover: Hardback\n";
    } else {
       os << "Cover: Paperback\n";
    os << "Price: $" << b.price_ << "\n";
    os << "ISBN: " << b.isbn_ << "\n";
    os << "Copies: " << b.copies_;
    return os;

Book Book::operator=(const Book& b) {
    if (*this == b) { // it assign to itself
       // noting will be done
       return *this;
    title_ = b.title_;
    authorCount_ = b.authorCount_;
    for (int i = 0; i < authorCount_; i++) {
       authors_[i] = b.authors_[i];
    publisher_ = b.publisher_;
    yearPublish_ = b.yearPublish_;
    hardCover_ = b.hardCover_;
    price_ = b.price_;
    isbn_ = b.isbn_;
    copies_ = b.copies_;
    return *this;

By purchasing this solution you'll be able to access the following files:

50% discount

$50.00 $25.00
for this solution

or FREE if you
register a new account!

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

Find A Tutor

View available C-Family Programming Tutors

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.

Upload a file
Continue without uploading

We couldn't find that subject.
Please select the best match from the list below.

We'll send you an email right away. If it's not in your inbox, check your spam folder.

  • 1
  • 2
  • 3
Live Chats