Question: Task 15: Suddenly, the first and second students want to change their advisor each other, while the advisor for the third student wants to withdraw

Task 15: Suddenly, the first and second students want to change their advisor each other, while

the advisor for the third student wants to withdraw from being appointed as an advisor. Write the code to implement these situations.

#include using namespace std;

class Project{ private: string title; public: Project(string _title=""){ setTitle(_title); }

void setTitle(string _title) {title = _title;} string getTitle()const {return title;} };

class Contact{ private: string phone; string email; public: Contact(string _phone="", string _email=""){ setPhone(_phone); setEmail(_email); }

void setPhone(string _phone) {phone = _phone;} void setEmail(string _email) {email = _email;} string getPhone() const {return phone;} string getEmail()const {return email;} };

class Person{ protected: string name; public: Person(string _name="", string _phone="", string _email=""){ }

void setName(string _name) {name = _name;} string getName() const {return name;} void setEmail(string _email) { } void setPhone(string _phone) { }

string getPhone() const { } string getEmail() const { } };

class Staff : public Person{ protected: string position; public: Staff(string _name="", string _phone="", string _email="", string _position="") { }

void setPosition(string _position) {position = _position;} string getPosition() const {return position;} };

class Student : public Person{ protected: string program;

public: Student(string _name="", string _phone="", string _email="", string _program="", string _projectTitle="") { }

void setProgram(string _program) {program = _program;} string getProgram() const {return program;} void setAdvisor(Staff *_advisor) { } string getProjectTitle() const { } string getAdvisorName() const {

}

string getAdvisorPosition() const {

} };

int main() { Staff advisor1("Prof. Dr. Muhammad Roslan Abdullah", "019-9875678", "mroslana29........com","Lecturer"); Staff advisor2("Mr. Qamarool Zaman", "011-56781234", "qam23....com","Senior Technician"); Staff advisor3("Dr. Siti Zubaidah Rosli", "010-1117456", "ctzr983......com","Research Officer");

cout << endl << "-------------- First Printing -----------------------" << endl << endl; for (int i=0; i<3; i++){ cout << "Student # " << (i+1) << endl; cout << "Name : " << endl; cout << "Phone : " << endl; cout << "Email : " << endl; cout << "Project Title : " << endl; cout << "Advisor's Name : " << endl; cout << "Advisor's Position : " << endl; cout << endl; }

cout << endl << "-------------- Second Printing -----------------------" << endl << endl;

//

cout << endl << "-------------- Third Printing -----------------------" << endl << endl; system("pause"); return 0; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!