Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

kindly do in c++ no built in functions is allowed. Object Oriented Programming-FALL 2021 Assignment 3 Instructions: 1. C++ codes must be submitted on Portal

image text in transcribed

kindly do in c++ no built in functions is allowed.

Object Oriented Programming-FALL 2021 Assignment 3 Instructions: 1. C++ codes must be submitted on Portal before 17th January 2022 (11:59pm) 2. Submit a single zipped file containing three folders (one for each question) 3. Write your name, section and registration number before the start of each code (in comments). 4. You already know the consequences of cheating. 5. Whether mentioned or not, provide copy constructor, destructors, getters and setters, display appropriate input and output messages and make a complete main program too. TASK 1 Imagine a publishing company that markets both book and audiocassette versions of its works. Create a class publication that stores the title (a string) and price (type float) of a publication. From this class derive two classes: book, which adds a page count (type int), and tape, which adds a playing time in minutes (type float). Each of these three classes should have a getdata() function to get its data from the user at the keyboard, and a putdata() function to display its data. Write a main() program to test the book and tape classes by creating instances of them, asking the user to fill in data with getdata(), and then displaying the data with putdata(). TASK 2 Start with the publication, book, and tape classes of TASK 1. Add a base class sales that holds an array of three floats so that it can record the dollar sales of a particular publication for the last three months. Include a getdata() function to get three sales amounts from the user, and a putdata() function to display the sales figures. Alter the book and tape classes so they are derived from both publication and sales. An object of class book or tape should input and output sales data along with its other data. Write a main() function to create a book object and a tape object and exercise their input/output capabilities TASK 3 Assume that the publisher in TASK 1 and 2 decides to add a third way to distribute books: on computer disk, for those who like to do their reading on their laptop. Add a disk class that, like book and tape, is derived from publication. The disk class should incorporate the same member functions as the other classes. The data item unique to this class is the disk type: either CD or DVD

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

Pro SQL Server Administration

Authors: Peter Carter

1st Edition

1484207106, 9781484207109

More Books

Students also viewed these Databases questions

Question

What does Processing of an OLAP Cube accomplish?

Answered: 1 week ago