Answered step by step
Verified Expert Solution
Link Copied!

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 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Microsoft Visual Basic 2005 For Windows Mobile Web Office And Database Applications Comprehensive

Authors: Gary B. Shelly, Thomas J. Cashman, Corinne Hoisington

1st Edition

0619254823, 978-0619254827

More Books

Students also viewed these Databases questions

Question

Comment should this MNE have a global LGBT policy? Why/ why not?

Answered: 1 week ago