Q1: Create Hayden and Noble classes - Subclasses of Book Class (Inheritance) (10 points) File: Hayden.h (5 points) // Q1a: Create Hayden Class // Part 1: Create a child class of the Book class named Hayden // Part2: Declare constructor which accepts the same 3 parameters as the parent class Book. // Pass the 3 parameters to the super constructor in the Book class. // Part 3: Re-declare the method displayBooklnfo () (virtual method of parent class Book) File: Noble.h (5 points) // Q1b: Create Drama Class // Part 1: Create a child class of the Book class named Noble // Part2: Declare constructor which accepts the same 3 parameters as the parent class Book. // Pass the 3 parameters to the super constructor in the Book class. // Part 3: Re-declare the method displayBooklnfo () (virtual method of parent class Book)
Explanation / Answer
class Noble : public Book { public: Noble (string bookName, int noOfBooksAvailable, Library libraryNumber): Book(bookName, noOfBooksAvailable, libraryNumber) {} void displayBookInfo() { cout