| 1234567891011121314151617181920212223 |
- #include <string>
- #include "Book.h"
- Book::Book(){ // default constructor
- title = ""; // no title
- author = ""; // no author
- pageNum = 0; // zero pages
- } // makes "books" without pages
- Book::Book(std::string title, int pageNum){ // useful constructor
- this->title = title; // set title
- this->pageNum = pageNum; // set number of pages
- author = ""; // still no author
- }
- std::string Book::getTitle(){ // get the book's title
- return title;
- }
- int Book::getPageNum(){ // get the number of pages
- return pageNum;
- }
|