Answered step by step
Verified Expert Solution
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++
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
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