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 44
|
#include<iostream>
#include <string>
using namespace std;
typedef struct
{
int day;
int month;
int year;
} DOBTEMP;
class personalInformationClass {
private:
int age;
DOBTEMP DOB;
string name ;
string comments;
public:
personalInformationClass::personalInformationClass(int AGE, int MONTH, int DAY, int YEAR, string NAME)
{
age = AGE;
populateDOB(DAY, MONTH, YEAR);
getline (cin, NAME);
}
personalInformationClass::personalInformationClass(int AGE, int MONTH, int DAY, int YEAR, string NAME, string COMMENTS)
{
age = AGE;
populateDOB(DAY, MONTH, YEAR);
getline(cin, COMMENTS);
}
void populateDOB(int D, int M, int Y)
{
DOB.day = D;
DOB.month = M;
DOB.year = Y;
}
int getAge()
{
return age;
}
};
|