Add to class Person copy constructor overloaded = operator destructor I need hel
ID: 3762156 • Letter: A
Question
Add to class Person
copy constructor
overloaded = operator
destructor
I need help in figuring out how to complete these tasks since I'm really confused as to what needs to be done. I need help with this tonight since this is an assignment. If anyone can help that would be appreciated.
Thanks.
//Person class demo
//Person.h - interface
#include
#include
#include "Date.cpp"
using namespace std;
class Person
{
public:
Person();
Person(string, int, Date);
string getName();
int getAge();
void setName(string newName);
void setAge(int newAge);
Date* getBirthDate();
void setBirthDate(Date);
void display();
//private:
string name;
int age;
Date* birthDate;
};
Explanation / Answer
#include<iostream>
#include<string.h>
#include "Date.cpp"
using namespace std;
class Person
{
public:
Person();
Person(string, int, Date);
string getName();
int getAge();
void setName(string newName);
void setAge(int newAge);
Date* getBirthDate();
void setBirthDate(Date);
void display();
//private:
string name;
int age;
Date* birthDate;
Person(Person&);
void operator=(Person&);
~Person();
};
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.