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

Database And Transaction Processing

Authors: Philip M. Lewis, Arthur Bernstein, Michael Kifer

1st Edition

0201708728, 978-0201708721

More Books

Students also viewed these Databases questions

Question

Brief the importance of span of control and its concepts.

Answered: 1 week ago

Question

What is meant by decentralisation?

Answered: 1 week ago

Question

8. Explain the relationship between communication and context.

Answered: 1 week ago

Question

d. How were you expected to contribute to family life?

Answered: 1 week ago