Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

A school wants to store information about its students joining a mentoring programme that the school currently nuns. The students are divided into two groups,

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

A school wants to store information about its students joining a mentoring programme that the school currently nuns. 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 CHIDE such as DevCpp. Use the codebase program provided, inain.cpp Student Abbreviations: name Studentin) getName() setName(n) displayinfo) 1: name 1: level e: email p : phone x: expertise m: mentee Mentee Mentor level expertise Menteen. e, p.) displayinfo) Mentorn, x) displayinfo) assignmentee(m) getMentee Contact email phone Contacte,p) displayInfo() getEmail) setEmaille) getPhone) setPhone(p) Figure 1: Class diagram Table 3: Description of the members of each class. Description Class Meinber's class Student name Student () getName() and setName() Student's name. A constructor Accessor and mutator methods. displays the student's information displayInfo() class Mentee level The class attribute indicating the level of progress for each mentee. There are five levels, from 1 to 5, where level 5 indicates mastery level. Mentee () A constructor. displayInfo() displays the mentee's information including name, email, phone and level, class Mentor expertise The mentor's area of expertise that he or she can be coaching, e.g., "CH Programming", "Game Programming, etc. Mentor() displayInfo assignMentee () A constructor. displays the mentor's information. assigns a mentee to the mentor. returns the mentee's name of the mentor. However, if the mentor has not been assigned to any mentee, this method will return an empty string. getMentee () classs attributes. A constructor class Contact email, phone Contact() getEmail(). setEmail(), getPhone () and setPhone () Accessor and mutator methods. displayInfo() displays the contact information 2. The problem given above involves several OOP concepts including inheritance and polymorphism a Explain TWO (2) main roles of the inheritance concept in the above problem. Indicate in which part of the class diagram these roles take place. (16 marks) b. Explain how the concept of polymorphism plays the role in the above problem (10 marks) c. Identify TWO (2) methods that will be specified as polymorphic. Justify your answer. Finaly, explain how you are going to make these methods polymorphic. (12 marks)

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

Students also viewed these Databases questions

Question

18. If you have power, then people will dislike and fear you.

Answered: 1 week ago