This is C++ Programming
Given the following classes:
#include class Person{ char* name;public: Person(); Person(const char*); void setName(const char* nm); void display(std::ostream&) const; Person(const Person&); // copy constructor Person& operator=(const Person& src); // copy assignment ~Person();};class Student : public Person{ int no; float* grade; int ng; void init(int, int, const float*);public: Student(); Student(int); Student(const char*, int, const float*, int); Student(const Student&); // copy constructor Student& operator=(const Student& src); // copy assignment ~Student(); void display(std::ostream&) const;};write implementation for the following functions (you can call other functions from these classes if you want assuming that they are implemented): ~Person(); Person& Person::operator=(const Person& p); Student(const Student&);
class Person
{
char* name;
public:
Person();
Person(const char*);
void setName(const char* nm);
void display(std::ostream&) const;
Person(const Person&); // copy constructor
Person& operator=(const Person& src); // copy assignment
~Person();
};
class Student : public Person
int no;
float* grade;
int ng;
void init(int, int, const float*);
Student();
Student(int);
Student(const char*, int, const float*, int);
Student(const Student&); // copy constructor
Student& operator=(const Student& src); // copy assignment
~Student();
write implementation for the following functions (you can call other functions from these classes if you want assuming that they are implemented):
Person& Person::operator=(const Person& p);
Student(const Student&);
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here