Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi, for this question I am confused on the issue of header and .cpp file. Could someone kindly provide the answer, if possible? Thanks Write
Hi, for this question I am confused on the issue of header and .cpp file. Could someone kindly provide the answer, if possible? Thanks
Write a C++ class called Book, which inherits from the Publication class given below. A Book has a year and a publisher and has its own display() method which prints out all information about a book, i.e. author, title, year and publisher. Book should also have a constructor which allows all book information to be initialised and a destructor which prints out a message when a Book object is destroyed. Explain the meaning of the virtual keyword, used in the definition of the display() method. class Publication protected: string author, title; public: Publication(string ar, string tl) : author (ar), title(tl) ( ) virtual void display() coutStep 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