Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.
Imagine a publishing company that markets both books and audiocassette versions of its works. Create a class publication that stores the title (a...
Can someone help me with creating the base sale class and the main method?
Thank you.
#include <iostream>
#include <string>
using namespace std;
class Publication {
private:
string title;
double price;
public:
void readData(){
cout << "Enter Title: " << endl;
cout << "Enter Price: " << endl;
cin >> title;
cin >> price;
}
void displayData()
{
cout << "Publication title: " << title << endl;
cout << "Publication price: " << price<<endl;
}
};
class book : public Publication
{
private:
int pageCount;
public:
void readData(){
Publication::readData();
cout << "Enter book page count: ";
cin >> pageCount;
}
void displayData(void)
{
Publication::displayData();
cout<< "Pages: " << pageCount << endl;
}
};
class tape : public Publication
{
private:
double minutes;
public:
void readData(){
Publication::readData();
cout << "Enter time in minutes :";
cin>>minutes;
}
void displayData(void)
{
Publication::displayData();
cout << "Time in minutes : " << minutes << endl;
}
};
class sales : public Publication
{
int main(){
}
Imagine a publishing company that markets both books and audiocassette versions of its works. Create a class publication that stores the title (a string) and price (double) of a publication.From this class derive two classes:1. book, which adds a page count (type int), and2. tape, which adds a playing time in minutes (type double). Each of these three classes should have a readData() function to get its data from the user at the keyboard, and a displayData() function to display itdata.Write a main () program to test the book and tape classes by creating a pointer of them asking the user to fill in data with readData (), and then displaying the data with displayData ().Use the following data for the book:title: Gone with the wind. price: 59.99pages: 566Use the following data for the tape:title: Beethovenprice: 99.99time in minutes: 60upload the code and the output as part 1.Now create another base class called sales; that holds an array of the three doubles so that you can record the dollar sales of a particular publication (books or tapes) for the last 3 months (use any numbers youwish). Include a readData () function to get 3 sales amounts from the user, and a displayData () 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.Modify the main () program to create an array of 3 book objects and 2 tape objects and exercise their input/output capabilities.Use any number for the books' pages, and the tapes' times. Use any amount for the 3 month sales. Use your own data for the titles and the prices.