Answer to Question #222496 in C++ for Jaguar

Question #222496
Consider the following class definitions and answer the questions that follow:

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.
1
Expert's answer
2021-08-03T11:46:34-0400


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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS