Question: Question 3 IN C + + Consider the class definition below and answer the questions that follow: class InsurancePolicy { public: InsurancePolicy ( ) ;
Question IN C
Consider the class definition below and answer the questions that follow:
class InsurancePolicy
public:
InsurancePolicy;
InsurancePolicyint pNr string pHolder, double aRate;
~InsurancePolicy;
void setPolicyint pNr string pHolder, double aRate;int
getpNrconst;
string getpHolderconst;
double getaRateconst;
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,
getexcess and setexcessto 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
