Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

c++ Question 3: Consider a publishing company that sells both books and audio CDs of its works. (18 points) a) Create a class named Publication

c++
image text in transcribed
Question 3: Consider a publishing company that sells both books and audio CDs of its works. (18 points) a) Create a class named Publication that has two private data attributes: title (string) and price (float) b) Create two classes named Book and CD that are derived from the class Publication. Class Book has an additional private data attribute named page_count (int) and class CD has an additional private data attribute named minutes (float) representing the CD playing time. Each class should have the following functions: input_data() function to input data from the user at the keyboard, print_data() to displaying it. c) Write a program an array of pointers of type Publication of size 2. Use this array to create objects of Book and CD classes dynamically. Ask the user to fill in data (e.g. title, price and page count for book object). Print the details of the objects in the array. Note: you may add any necessary to functions to class Publication

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 Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions