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 MalikCpp("1-4188-3639-7","C++ Programming", "D.S. Malik", 72);
MalikCpp.display();
textbook CSII;
CSII.set("1-4188-3639-7","C++ Programming", "D.S. Malik", 72,"1501211", "Int. CS II");
CSII.display();
return 0;
}
Sample output:
The book information is as follow:
ISBN is: 1-4188-3639-7
Title is: C++ Programming
Author is: D.S. Malik
Price is: 72
The book information is as follow:
ISBN is: 1-4188-3639-7
Title is: C++ Programming
Author is: D.S. Malik
Price is: 72
The book is used as a textbook for the following course:
Course code is: 1501211
Course title is: Int. CS II
2/2

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!