Answer to Question #272519 in C++ for gchgc3

Question #272519

WAP to show the working of abstract class by considering suitable example


1
Expert's answer
2021-12-03T00:37:27-0500
#include <iostream>
using namespace std;


class publisher
{
public:
    string pname;
    string place;
    void get()
    {
        cout << "get the value" << endl;
    }
    void display()
    {
        cout << "display the value " << endl;
    }
};
class author
{
public:
    string aname;
    void get()
    {
        cout << "get the value" << endl;
    }
    void display()
    {
        cout << "display the value " << endl;
    }
};
class book : public publisher, public author
{
public:
    string title;
    int price;
    int pages;
    void get()
    {
        cout << "get the value" << endl;
    }
    void display()
    {
        cout << "display the value " << endl;
    }
};
int main()
{
    book obj;
    return 0;
}


Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS