Question: Question 3 IN C + + Consider the class definition below and answer the questions that follow: class InsurancePolicy { public: InsurancePolicy ( ) ;

Question 3 IN C++
Consider the class definition below and answer the questions that follow:
class InsurancePolicy
{
public:
InsurancePolicy();
InsurancePolicy(int pNr, string pHolder, double aRate);
~InsurancePolicy();
void setPolicy(int pNr, string pHolder, double aRate);int
get_pNr()const;
string get_pHolder()const;
double get_aRate()const;
private:
int policyNr; string
policyHolder;double
annualRate;
};
(a) Implement the class InsurancePolicy.
(b) Code the interface for a class CarInsurance derived from class
InsurancePolicy (the base class). This class has an additional member
variable, excess. Class InsurancePolicy also has member functions,
get_excess() and set_excess()to return the value of member
variable excess and update the value of member variable excess
respectively. The class CarInsurance should override function
showPolicy() in order to display the member variables of
CarInsurance and also override member function setPolicy() in
order to update the member variables of CarInsurance.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!