Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using C++, Create a base class named Book. Data fields include title and author; functions include those that can set and display the fields. Derive

Using C++,

Create a base class named Book. Data fields include title and author; functions include those that can set and display the fields.

Derive two classes from the Book class: Fiction, which also contains a numeric grade reading level, and NonFiction, which contains a variable to hold the number of pages.

The functions that set and display data field values for the subclasses should call the appropriate parent class functions to set and display the common fields, and include specific code pertaining to the new subclass fields.

Write a test program that demonstrates the use of the classes and their functions.

Sample Run Book is Scarlet Letter by Hawthorne Reading level is 10 Book is Log Cabin Building by Landers 328 pages 

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

Concepts of Database Management

Authors: Philip J. Pratt, Mary Z. Last

8th edition

1285427106, 978-1285427102

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago