Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

PLEASE HELP ME TO ANSWER THIS QUESTION I ONLY HAVE 1 HOUR LEFT HERE IS THE CODEBASE PROGRAM #include #include using namespace std; // The

PLEASE HELP ME TO ANSWER THIS QUESTION I ONLY HAVE 1 HOUR LEFT

image text in transcribed

image text in transcribed

image text in transcribed

HERE IS THE CODEBASE PROGRAM

#include #include using namespace std;

// The declaration for class 'Contact' is fully given. Do nothing to it. // As for other classes, the declaration are partially given. Complete the rest.

class Contact { string email; string phone;

public: Contact(string e = "", string phone = ""); string getEmail() const; void setEmail(string e); string getPhone() const; void setPhone(string p); void displayInfo() const; };

class Student { public: Student(string n = ""); };

class Mentee { public: Mentee(string n = "", string e = "", string p = "", int l = 0); };

class Mentor { public: Mentor(string n = "", string x = ""); };

//-------------------------------------------------------------------------------------------------------------

//Definition for the class 'Contact' is fully given. Do nothing to it.

Contact::Contact(string e, string p) : email(e), phone(p) {} string Contact::getEmail() const { return email; } void Contact::setEmail(string e) { email = e; } string Contact::getPhone() const { return phone; } void Contact::setPhone(string p) { phone = p; } void Contact::displayInfo() const { cout

int main() { system("pause"); //Uncomment this line if you are using VS Code return 0; }

3. Implement the class diagram in C++. Separate the class definition from the class declaration within the same file. Accomplish the following tasks in your program. Write your code in the provided codebase program. Note that some of the code has been given in the codebase program a. Complete the declaration of all classes. (12 marks) b. Define all the methods of the class Student. ( 6 marks) c. Define all the methods of the class Mentee. (5 marks) d. Define all the methods of the class Mentor. (13 marks) e. In the main function, declare two arrays below: an array of mentees an array of mentors and initialize the arrays with the sample data given in Table 1 and Table 2. (5 marks) Table 1: Sample data for mentee students No Mentee's name Email Phone 1 Abdul Samad asamad892@gmail.com 013-89001000 2 Siti Nurdiana ct.nur@yahoo.com 011-123013456 Level 2 2 2 Table 2: Sample data for mentor students No Mentor's name Expertise 1 Ahmad Kamal Web Programming 2 Siti Aminah Java and C++ f. Declare another array to hold a list of students and fill in the array with all the mentees and mentors created in 3(e). (3 marks) g. Using a loop, print the list created in 3(f). The output should look like as in Figure 2. (2 marks) h. Using the array created in 3(e), assign the second mentee to the second mentor. (1 mark) i. Using a loop and the array created in 3(e), print the list of mentors and their mentee. Print only the names. See Figure 2 for the expected output. (3 marks) The list of students Student #1 Mentee's Name : Abdul Samad Mentee's Email : asamad892@gmail.com Mentee's Phone : 013-89001000 Mentee's Level : 2 Student #2 This student is a mentor Name : Ahmad Kamal Expertise : Web Programming Information about the mentee under him/her: Mentee's Name : Abdul Samad Mentee's Email : asamad892@gmail.com Mentee's Phone : 013-89001000 Mentee's Level : 2 Output of question 3(g) Student #3 Mentee's Name : Siti Nurdiana Mentee's Email : ct.nur@yahoo.com Mentee's Phone : 011-123013456 Mentee's Level : 1 Student #4 This student is a mentor Name : Siti Aminah Expertise : Java and C++ ** No mentee yet ** Mentor Mentee Ahmad Kamal Siti Aminah Abdul Samad Siti Nurdiana Output of question 3 (i) Figure 2: Program output

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essential SQLAlchemy Mapping Python To Databases

Authors: Myers, Jason Myers

2nd Edition

1491916567, 9781491916568

More Books

Students also viewed these Databases questions

Question

Explain the function and purpose of the Job Level Table.

Answered: 1 week ago