Question: This is one entire question that has to be implemented together at the same time, so u cant solve one and leave the other, it

This is one entire question that has to be implemented together at the same time, so u cant solve one and leave the other, it should be all together and it says in q1 that u need a file book so I copy and pasted the header and source file below for you to use to solve this.This is one entire question that has to be implemented together atthe same time, so u cant solve one and leave the other,source file:

#include "Book.h" #include #include using namespace std;

Book::Book(string title_, string author_, int issueYear_, int pages_){ this->title_=title_; this->author_=author_; this->issueYear_=issueYear_; this->pages_=pages_; }

void Book::setTitle(string title_){ this->title_=title_; } void Book::setAuthor(string author_){ this->author_=author_; } void Book::setIssueYear(int issueYear_){ this->issueYear_=issueYear_; } void Book::setPages(int pages_){ this->pages_=pages_; }

string Book::getTitle(){ return this->title_; } string Book::getAuthor(){ return author_; } int Book::getIssueYear(){ return issueYear_; } int Book::getPages(){ return pages_; }

void Book::printDetails(){ couttitle_author_issueYear_pages_

Book::~Book(){ cout

header file:

#include using namespace std;

#ifndef BOOK_H #define BOOK_H class Book{

string title_; string author_; int issueYear_; int pages_;

public:

Book(string title_, string author_, int issueYear_, int pages_);

void setTitle(string title_); void setAuthor(string author_); void setIssueYear(int issueYear_); void setPages(int pages_);

string getTitle(); string getAuthor(); int getIssueYear(); int getPages();

void printDetails();

~Book();

};

#endif

The following diagram illustrates the classes you will implement in this lab and their relationships. Book Private (-) title Type: string (-) author Type: string (-) issue Year Type: int (-) pages Type: int (+) Parameterized Constructor (+) Setters (+) Getters (+) printDetails : void Public NormalBook EBook (-) weight (-) print Type Type: int Type: string (+) Parameterized Constructor (+) Getters (+) Setters (-) sizeInByte Type: int (-) fileType Type: string (+) Parameterized Constructor (+) Getters (+) Setters QUESTION 1: The implementation of class Book is uploaded to the elearning. Copy Book.h and Book.cpp to your project. QUESTION 2: 1. Implement class NormalBook, which inherits from class Book (use public inheritance). 2. Function printDetails of the base class should be overridden to print the additional information about the weight and print type. QUESTION 3: Implement class EBook, which inherits from class Book (use protected inheritance). 1. Function getTitle in the base class should be overridden to return the title + "(E-Book)". 2. Function printDetails of the base class should be overridden to print the additional information about the size in bytes and file type. QUESTION 4: Implement a driver program to test your code. 1. create an object of type NormalBook, assign the appropriate values for each data member, don't forget to assign values to parent class data members. 2. create an object of type EBook, assign the appropriate values for each data member, don't forget to assign values to parent class data members. 3. print the details of both objects. 4. change the title for both objects to be "New title". Justify any error occurs. 5. print the title for both objects

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!