class Date {
public:
Date(int day, int month, int year);
int GetYear() const;
private:
int Day;
int Month;
int Year;
};
class Person{
public:
Person(const string &name, const string &address, const
Date &date);
string GetAddress() const;
string GetName() const;
private:
string Name;
string Address;
Date DateOfBirth;
};
class Customer{
public:
Customer(const string &name, const string &address,
int day, int month, int year,double creditlimit);
void IncreaseLimit(double amount);
string GetName() const;
string GetAddress() const;
void SetBalance(double balance);
double GetBalance() const;
private:
string Name;
string Address;
int DayOfBirth;
int MonthOfBirth;
int YearOfBirth;
double CreditLimit;
double BalanceDue;
};
//(b) Implement the constructor for the derived Customer class.
Customer::Customer(const string &name, const string &address,int day, int month, int year,double creditlimit) {
Name=name;
Address=address;
DayOfBirth=day;
MonthOfBirth=month;
YearOfBirth=year;
CreditLimit=creditlimit;
}
Comments
Leave a comment