-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBook.cpp
More file actions
39 lines (35 loc) · 1.24 KB
/
Copy pathBook.cpp
File metadata and controls
39 lines (35 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Subclass of Item
// A book object. Handles the creation and storage of a
// book, containing title, author, number of copies "owned" by the library,
// and copies of this book currently checked in. Parent class of fictionbook,
// periodicalbook, and childrenbook.
//
// Assumptions:
// -- book copies will be initialized by subclass
// -- all books will have a title
//
// Implementation:
// -- available and total copies initialized to 0 for generic book object
// -- subclasses will initialize total and available copies
//
//---------------------------------------------------------------------------
#include "Book.h"
#include <iostream>
using namespace std;
//---------------------------------------------------------------------------
// constructor
Book::Book() {
title_ = "";
format_ = 'H';
availableCopies_ = 0;
totalCopies_ = 0;
}
//---------------------------------------------------------------------------
// destructor
Book::~Book() {}
//---------------------------------------------------------------------------
// setTitle
void Book::setTitle(string incomingTitle) { title_ = incomingTitle; }
//---------------------------------------------------------------------------
// getTitle
string Book::getTitle() const { return title_; }