Example #1
0
    void add(Book currentBook) {
        //Book myBook = Book(bookName, bookThickness);
        if (shelfSpace < currentBook.getBookLength()) {
            int temp = shelf.back().getBookLength();
            shelfSpace += temp;
            shelf.pop_back();
            add(currentBook);

        } else {
            shelf.push_front(currentBook);
            shelfSpace -= currentBook.getBookLength();
        }

    }
Example #2
0
 bool operator ==(const Book& other) {
     if(this->getTitle()==other.getTitle()&&this->getBookLength()
             ==other.getBookLength()) {
         return true;
     } else
         return false;
 }