Answered step by step
Verified Expert Solution
Question
1 Approved Answer
my second time posting this question, c++ object oriented main.cpp: Driver implem.cpp : Class implementation define h : Class definition Book Types The following diagram
my second time posting this question, c++ object oriented
main.cpp: Driver implem.cpp : Class implementation define h : Class definition Book Types The following diagram illustrates the classes you will implement in this lab and their relationships. Book (-) title Type: string (-) author Type: string (-) issue Year Type: int i (-) pages Type: int a t e P u b 1 i (+) Parameterized Constructor (+) Setters (+) Getters (+) print Details : void NormalBook (-) weight Type: int (-) printType Type: string (+) Parameterized Constructor (+) Getters (+) Setters EBOOK (-) sizeInByte Type: int (-) fileType Type: string (+) Parameterized Constructor (+) Getters (+) Setters NOTE 1: In all of your code, do not forget to validate all user input and to make all functions that do not modify the class constant. NOTE 2: Do not put all of your code in one file; separate implementation from the interface. NOTE 3: Avoid duplication of code! If something is already done in the base class, do not do it again in the derived class. Implement class Book. Function printDetails should print information about the book in a well-formatted manner. Implement class NormalBook, which inherits from class Book. Note the following: The weight data member represents the weight of the book in grams. The printType data member can be either "Hard-Cover" or "Paperback". Function printDetails of the base class should be overridden to print the additional information about the weight and print type. Implement class EBook, which inherits from class Book. Note the following: The fileType data member can be PDF, EPUB, CHM or AZW. Function getTitle in the base class should be overridden to return the title + "(E-Book)". Function printDetails of the base class should be overridden to print the additional information about the size in bytes and file type. Implement a driver program to test your code. - Create an object of type NormalBook, assign the appropriate values for each data member, and don't forget to assign values to parent class data members. (8 points) - Create an object of type EBook, assign the appropriate values for each data member, and don't forget to assign values to parent class data members. (8 points) - Print the details of both objects. (6 points) Write a friend function to the NormalBook class to check if an object exist in a certain year, or not. Print out the result in main. (10 points)Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started