Question
Question need help to complete below: Consider the following incomplete class definitions. Fill in the missing code as described in the comments. Your solution should
Question need help to complete below:
Consider the following incomplete class definitions. Fill in the missing code as described in the comments. Your solution should call the appropriate set and get functions on a Book object.
class Book{
public:
//Provide:
// - a pure virtual function to set the ISBN/eISBN
// - a pure virtual function to get the ISBN/eISBN
};
// create an EBook class that inherits from Book
{
int eISBN;
public:
void set(const int _eISBN){eISBN=_eISBN;};
int get() const{return eISBN;};
};
// create a PaperBook class that inherits from Book
{
int isbn;
public:
void set(const int _isbn){isbn=_isbn};
int get() const{return isbn;};
};
Additionally, describe in a couple of sentences the purpose of a pure virtual member function.
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