Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

//---------------------------------------------------------------------------------------- // Use this codebase program to answer Question 3 //---------------------------------------------------------------------------------------- // #include #include using namespace std; // The declaration for class 'Contact' is fully

image text in transcribedimage text in transcribedimage text in transcribed

//---------------------------------------------------------------------------------------- // Use this codebase program to answer Question 3 //---------------------------------------------------------------------------------------- //

#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() { return 0; }

A school wants to store information about its students joining a mentoring programme that the school currently runs. The students are divided into two groups, mentors and mentees. Mentors are more knowledgeable students and offer helps to mentees. Mentors are chosen from those students with good CPAs. They can mentor only one mentee maximum. Mentee's progress are kept track based on their levels, i.e., from level 1 to 5 where 5 indicates a mastery level. Besides, mentee's contact information will also be stored. Given a class diagaram that models the above problem in Figure 1 and the details about it the class diagram in Table 3. Answer the questions 1 to 3 below. Note: As for questions 1 and 2, write your answers on papers, and for question 3, write your program using any CH IDE such as DevCpp. Use the codebase program provided, main.cpp. 3. Implement the class diagram in Ch. 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 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 3e). (3 marks) g. Using a loop, print the list created in 3(1). 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) A school wants to store information about its students joining a mentoring programme that the school currently runs. The students are divided into two groups, mentors and mentees. Mentors are more knowledgeable students and offer helps to mentees. Mentors are chosen from those students with good CPAs. They can mentor only one mentee maximum. Mentee's progress are kept track based on their levels, i.e., from level 1 to 5 where 5 indicates a mastery level. Besides, mentee's contact information will also be stored. Given a class diagaram that models the above problem in Figure 1 and the details about it the class diagram in Table 3. Answer the questions 1 to 3 below. Note: As for questions 1 and 2, write your answers on papers, and for question 3, write your program using any CH IDE such as DevCpp. Use the codebase program provided, main.cpp. 3. Implement the class diagram in Ch. 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 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 3e). (3 marks) g. Using a loop, print the list created in 3(1). 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

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

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions

Question

5. How do instructional objectives help learning to occur?

Answered: 1 week ago

Question

4. Help trainees set challenging mastery or learning goals.

Answered: 1 week ago