-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLife.h
43 lines (28 loc) · 744 Bytes
/
Life.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* Life class header file */
#ifndef _Life_h_
#define _Life_h_
#include "InsurancePolicy.h"
class Life : public InsurancePolicy
{
protected:
int age;
string dependent;
float termLife;
public:
// constructor
Life(string n="", int a=0, string d="", float t=0);
// deconstructor
~Life() {}
// calculate commission
void calcCommission();
// access methods
void setAge(int a) { age = a; }
void setDependent(string d) { dependent = d; }
void setTermLife(float t) { termLife = t; }
int getAge() { return age; }
string getDependent() { return dependent; }
float getTermLife() { return termLife; }
// print method -- used in overloaded stream << operator
void print(ostream &strm) const;
};
#endif