Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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