// CIS 235 #include "book.h" #include using std::endl; using std::cin; using std::cout; book::book(const book & o) : invent(o) // Member Initialization List { hardBack = o.hardBack; } book::book(void): invent() // Member Initialization List { hardBack = 'Y'; } book::book(long cd, long n, double cst, double pr, char cl) : invent( cd, n, cst, pr ) // Member Initialization List { hardBack = cl; } book::~book(void) { cout << "Book object leaving at address " << this << endl; } bool book::isHardBack(void) const { return (hardBack == 'y' || hardBack =='Y'); } const book & book::print(ostream & o) const { invent::print(o); // use scoping to call inherited overridden method o << "Type: " << (isHardBack() ? "Hardback" : "Softback") << endl; return *this; } book & book::kinput(void) { cout <<"Enter data for a book\n"; invent::kinput(); // use scoping to call inherited overridden method cout << "Enter y if hardback "; cin >> hardBack; return *this; } string book::identify(void) const { return string("book"); }