Assuming you have the following classes.
class Student
{
private:
int SID; //student Identifier
string Fname; // Student First Name
string Lname; // Student Last Name
public:
void setSID(int id) { SID = id; }
void setFname(string name) { Fname = name; }
void setLname(string name) { Lname = name; }
void print()
{
cout << "Student Data:" << endl;
cout << SID << "." << Fname << " " << Lname << endl;
}
};
class Teacher
{
private:
int ID;// Teacher ID
string FirstN; // Teacher First Name
string LastN; // Teacher Last Name
int numStd; // Number of student that Teacher has
Student *ptr; // Pointer of Student data type
public:
Teacher(int s, string f, string l, int n);
void print() const;
};
A) Write the implementation of Teacher initializer Constructor (with parameters) and do the
following:
1. Set the value of ID, FirstN, LastN, and numStd.
2. Build a dynamic array of size "numStd" using the pointer ptr.
3. Assign the value of FirstN of class Teacher to the member variable Lname of each Student
in the array.
B) Write the implementation of print function: that prints the ID, first name, the last name,
and the number of his students, then prints the SID, first name, and the last name of all of his
student
C) Write the implementations of Destructor that deletes the dynamic array