A Lil Help With Inheritance...
Ok I Got a lil project and am seeking a bit of help with my header files (interfaces). I just want some help to clear up the headers before i jump on the implementation...Thanks in advance for your help and here is the code.
Code:
#ifndef Insurance_header
#define Insurance_header
//Parent Class
class MainIns{
int pol_num;//policy number
string pol_hol;//policy holder
int eff_date;//effective date of policy
int exp_date;//expiry date of policy
float ins_prem;//premimum for the policy
public:
MainIns();//default constructor, used to instantiate the object
~MainIns();//Destructor
//Accessors
int getPolNum();
string getPolHol();
int getEffDate();
int getExpDate();
float getInsPrem();
//Mutators
void setPolNum(int);
void setPolHol(string);
void setEffDate(int);
void setExpDate(int);
void setInsPrem(float);
};
#endif
Code:
#ifndef Life_Insurance_Header
#define Life_Insurance_Header
#include "Life_Insurance_Header.h"
class LifeIns{
string per_name;
int per_age;
string fl_address;
string sl_address;
string occupation;
friend MainIns insurance(MainIns &);
public:
LifeIns();//constructor
~LifeIns();//destructor
//Accessors
string getPerName();
int getPerAge();
string getFLAdress();
string getSLAdress();
string getOccupation();
//Function to initialize attributes of MainIns for LifeIns
MainIns insurance (MainIns ins);
//Mutators
setPerName(string);
setPerAge(int);
setFLAdress(string);
setSLAdress(string);
setOccupation(string);
#endif