#include <iostream>
#include <string>
using namespace std;
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;
void showPolicy(ostream & out)const;
private:
int policyNr;
string policyHolder;
double annualRate;
};
void InsurancePolicy::showPolicy(ostream & out)const{
out<<"Policy Nr: "<<policyNr<<endl;
out<<"Policy Holder: "<<policyHolder<<endl;
out<<"Annual Rate: "<<annualRate<<endl;
}
class CarInsurance: public InsurancePolicy{
private:
string excess;
public:
void set_excess(string ex);
string get_excess();
void showPolicy(ostream & out)const;
};
void CarInsurance::showPolicy(ostream & out)const{
InsurancePolicy::showPolicy(out);
out<<"Excess: "<<excess<<endl;
}
int main(){
return 0;
}
Comments
Leave a comment