Question: Define a class called book with protected data members ISBN, title, author, price, and public member functions set ( ) , get ( ) ,
Define a class called book with protected data members ISBN, title, author, price, and public member
functions set get display and a parameterized constructor with default values for the first three
data members, and zero value for the price
Define a class called textbook, which publicly inherits the class book. It has the private data members
coureseCode, courseTitle and the member functions set display and a parameterized constructor
with default values.
Implement all member functions.
Use the following driver:
int main
book MalikCppC Programming", DS Malik", ;
MalikCpp.display;
textbook CSII;
CSII.setC Programming", DS Malik", "Int. CS II;
CSII.display;
return ;
Sample output:
The book information is as follow:
ISBN is:
Title is: C Programming
Author is: DS Malik
Price is:
The book information is as follow:
ISBN is:
Title is: C Programming
Author is: DS Malik
Price is:
The book is used as a textbook for the following course:
Course code is:
Course title is: Int. CS II
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
