Get insightful responses to your questions quickly and easily on IDNLearn.com. Get prompt and accurate answers to your questions from our experts who are always ready to help.
Sagot :
Answer:
Following are the class definition code to this question:
class UpdatedBook : BookInfo//defining a class UpdatedBook that inherits the BookInfo class
{
public:
int edition_Number;//defining an integer variable
UpdatedBook (string title,string author,int edition):BookInfo(b_title,b_author)//defining a constructor that
{
edition_Number=edition;
}
int getEdition_Number()
{
return edition_Number;
}
};
Explanation:
In this question, the "BookInfo" class is not defined, that's why we define this code as above.
In this code, a class "UpdatedBook" is defined that inherits its base class "BookInfo" inside the "UpdatedBook" class an integer variable "edition_Number" is declared, which is used to holding the integer value.
In the next step, a parameterized constructor is declared, that accepts a three-parameter and also inherits its base class parameterized constructor, and at the last, a get method is used that returns the edition number value.
We are happy to have you as part of our community. Keep asking, answering, and sharing your insights. Together, we can create a valuable knowledge resource. For clear and precise answers, choose IDNLearn.com. Thanks for stopping by, and come back soon for more valuable insights.