Question: Question School of Computing is planning to implement a mentoring programme involving all the students in the school. The programme will be run as follows:








Question School of Computing is planning to implement a mentoring programme involving all the students in the school. The programme will be run as follows: The students are divided into two categories, mentor and mentee. A mentor is a more knowledgeable student and offers helps to a mentee, a less knowledgeable student. Mentors are chosen from those students with good CPAs. Mentee's progress are kept track based on their levels, from level 1 to 5. There are two approaches of mentoring: -Coaching-based: mentors will coach their mentees in particular areas, e.g., "CH programming, "Game Programming, etc. Therefore, a coach must be expert in that area. -Support-based mentors offer their supports to the mentees without having to meet face to face. Thus, the mentors need to provide their phone numbers. Abbreviations: Student name Student (n) getName setName(n) n: m: name level mentor expertise phone P: Mentor Mentee level Mentee (n.) assignMentor (m) displayInfo() Mentorn, c) edit) print) Coach expertise Coach (n. c, e) getExpertise) setExpertise (e) edit) print) Support phone Support (n.cp) getPhone) setPhone (p) edit) print Figure 1: Class diagram for Mentoring System The school has hired you to develop a computer program to manage the records of the mentors and mentees. The class diagram for the program has been done by a senior software engineer and it is given in Figure 1 above. The classes are described further in Table I below. Table 1: Description of the members of each class Description Class Member's class Student name Student's name. A constructor. Accessor and mutator to the attribute. Studen(...) getNamel and sotName (...) 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. Merceei.... A constructor assignmensos...) To assign a mentor to mentee. displayinio ) To display the mentee's information including: name and level, his her mentor's details depending the type of the mentor, i.e. either a coach mentor or a support mentor. If no mentor is assigned yet, then this method will print a message indicating that. + class Mentor coa Mentor's cpa. Menteri...! A constructor. edit) To edit mentor information by the user. print) To print the mentor's name and cpa. class Coach expertise The mentor's area of expertise that he or she can be coaching, e.g., "C++ Programming", "Game Programming", etc. A constructor. Accessor and mutator to the attribute. getExpertise and setExpertise (...) cdit To edit mentor's expertise by the user. print!) To print the mentor's name, spa and expertise. The mentor's phone number. class Support phone Suppor...... getPhone:) and selPhone: ...) A constructor Accessor and mutator to the attribute. edi. To edit mentor's phone number by the user. print To print the mentor's name, cpa and phone. Based on the class diagram in Figure 1 and specifications in Table 1, answer the questions (a) to (c) below. Note: As for questions 1 and 2, write your answers in a separate text file. Indicate the question numbers in your answers. 1. Determine the type of relationship formed between the following classes: a. Mentee and Student b. Melee and Mentor c. Coach and Men..o d. Coach and Student. e. Coach and Mensce 2. Analyse the class diagram in Figure 1 and its description in Table 1 as well as the program's output in Figure 2. Same TWO (2) methods that later in the the code, will be declared as virtual. Justify your answers. 3. Finally, implement the class diagram by modifying code in exercise3.cpp. Complete the following tasks in the program. Your code must follow the class diagram. a. Task 1. Delcare all the classes based on the class diagram. b. Task 2: Define all methods for the class Mensos 0. Task 3: Define all methods for the class Ccach d. Task 4: Define all methods for the class Support e Task 5: Define all methods for the class Men-ee f. Task 6: In the main function, an array of mentees and two mentors have been created. Complete the remaining tasks. Scc Task 6(a) to (h) in the program. Output: The program should produce the output as shown in Figure 2. Note that, bold texts indicate user inputs. Screen 1: Displaying the current mentor. Mcal Select fiat martor 2. Select secora encor 8. Display selected mentor 4. Edit selected encor 5. Assign se ectea mentor to mentee 6. Unass-91. mer.Lor Eron menlee 7. Esplay all meatcez 9. Exil Choose an operation. [1-7, 00 9] => 3 Current seledled nenor: Ahad Kanal mentor) is the current mentor Screen 2: Assigning the current mentor to the first and second mentees (i.e index 0 and 1). Menn 1. Select first mertor 2. Select second menzor 3. Display selected mentor 4. Edil selecled nenor 5. Assign se_ectes mentor to rentee 6. Unase gr. mer.tor Erem mentes 7. Display al menlees 9. Ezit Choose an operatior. 11-7, O 91 => 5 Enter the index of mentee to assign with the current merror => 0 The menu is not included here for brevity Choose an opezatior. 11-7, or 9) => 5 Enter the index of mentee to assign with the current mentor => 1 Screen 3: Displaying the mentee list. The menu is not included here for brevity Choose an operatior. 11-7, O9] => 7 List of mertoes: # Mentee'a Nama : Abdul Samas Mentee's Level : 2 Mentoring tyna : Coach-based Mentor's Name : Ahmad Kamal Melor', CBA : 3.87 Mentor's Expertise : Programming #2 Mentce's Nams : Nursiana Menteel Level : 1 Mentoring type : Coach-based Mentor's Name : Ahmad Kamal Mentor's CPA Mentor's Expertise : Programming #3 Mentee's Name : Nuraz ar Ment.ee'a level : ** No menzor yet The last menee has yet to be assigned with a mentor Screen 4: Changing the current mentor to another and assigning it to the last mentee (index 2). 8 ========== Men ========== 1. Select first mer.Lor 2. Select secara mencer 3. Display zelec od mentor 2. hdit selected mentor 5. Assign sciected mentor torrentoc 6. Urass-gr mertor from rentae 7. Display a'l menteea 9. Exit Choose an operalior. [1-7, ou 9] => 2 Second mentor is se ested The mem is not included here for brevity> Choose an operatior. 11-7, or 9] => 5 Enter the index of mentee to assign with the current mertor => 2 Choose an operation 11-7,0 91 => 7 List of mer.Lees: # Meatee's Name : Abdul Samad Menteala Taval Mentoring type : Jaach-based Mentorla Name Ahmad Kamal Mentor'e CPA Mentor's Expertise : Programming Melele Name : Nurdiana Ment.ee's level : 1 Mentoring type : aach-based Mentor's Name : Ahmad Kamal Mentor's CPA Mentor's Expertise : Programming +3 Meldete Name : Nuraz_ar. Mentoo's Lovel : 2 Mentoring type: Support-based Mentor's Name : Siti Amirah Mentor's CPA Mentor's Phone : 0123456789 The last mentee now has a mentor 9 Screen 5: Changing the expertise info of the first mentor (.e., nen-crl) and the phone number for the second mentor (i.e. nentor2). Mau Select. fiat: marto 2. Select gecord yoncer 3. Display selected mentor 4. hdit, selected mencer 5. Assign se_ectea mentor to rentee 6. Urave gr. rer.lor from renlee 7. Display a__ menteee 9. Exil Choose an operation 11-7, o 9] => 1 Firsl nen.or is selecled The menu is nol included here for brevily> Choose an operatior [1-7, or 9] => 4 Mentor's Information: Mentoring type Coach-based Melor', Nane : Ahmad Karal Mentor'. CPA Mentor Expertise : Programming Current mentor is mentori (a coach mentor). Thus, editing will be on coach data. You can only cdi- the mentor's expertise Enter new experlize -> Mobile and Web Programming Choose an operatior. 11-7, or 9] => 2 Second mentor is c'ested The menu is not included here for brevity Choose an operatior. 11-7, or 9] => 4 Mentor's Informacion: Meiloring Lype : Support-based Mentor's Namo : Siti Amirah Meator'CPA : 3.98 Mentior's hone: 0123456789 Curent mentor is changed to mentor2 (a support-mentor). Thus, editing will be on support- mentor dota. You can only edi. the mentor's phone numbe" Enter new phone nucber => +6013-89001000 7 Liot of mertee 3: 10 Mentee's Nane : Abdul Samad Meantee's Level : 2 Mentoring type : Coach-based Mentor's Namc : Ahmad karral Mentor's CPA : 3.87 Mentor's Expertise : Mobile ard web Programming Here, the mentor's expertise has changed accordingly #2 Mentee's Name : Nurciana Melody Level : 1 Mentoring type : Coacl.-based Meator's Neno : Ahmad Karcal Mentor's CPA Mentor's Expertise : Mobile and web Programming Here, the mentor's expertise has changed accordingly. #3 Mentee's Name : Nuraz_ar Me.lee Level : 2 Mentoring type : Support-cased Mentor's Name : Sili Ardir.ah |-lepr's CF Mentor's Phone : 601 3-89001000 Here, the mentor's phone number has } changed accordingly Screen 6: Removing the mentor from cond mentee (i.e., 6 Enter the index of mentee to remove its rento" => 1 Choose an operatior. 11-?, OH 91 => 7 ri 1 List of monteca: #1 : Abdul Samad Mentee's Sevel : 2 Mentoring ye : Coach-based Mentor's Nama : Ahmad Kamal Mentor's CIA Mentor's Expertise : Mobile ad heb Programming : 3.37 #2 Menta', Nane Ndiana Montec's ovel : 1 ** NO mencor yet This mentee now does not have a mentor: #3 Mentee's Name ; Nurazlan Menteels evel 2 Mentoring -yoe : Suppor--based Mentor's Name : Sit! Brinat Mentor's CPA : 3. SS Mentor's Phone: +60 3-89CC-003 Figure 2: Program output Question School of Computing is planning to implement a mentoring programme involving all the students in the school. The programme will be run as follows: The students are divided into two categories, mentor and mentee. A mentor is a more knowledgeable student and offers helps to a mentee, a less knowledgeable student. Mentors are chosen from those students with good CPAs. Mentee's progress are kept track based on their levels, from level 1 to 5. There are two approaches of mentoring: -Coaching-based: mentors will coach their mentees in particular areas, e.g., "CH programming, "Game Programming, etc. Therefore, a coach must be expert in that area. -Support-based mentors offer their supports to the mentees without having to meet face to face. Thus, the mentors need to provide their phone numbers. Abbreviations: Student name Student (n) getName setName(n) n: m: name level mentor expertise phone P: Mentor Mentee level Mentee (n.) assignMentor (m) displayInfo() Mentorn, c) edit) print) Coach expertise Coach (n. c, e) getExpertise) setExpertise (e) edit) print) Support phone Support (n.cp) getPhone) setPhone (p) edit) print Figure 1: Class diagram for Mentoring System The school has hired you to develop a computer program to manage the records of the mentors and mentees. The class diagram for the program has been done by a senior software engineer and it is given in Figure 1 above. The classes are described further in Table I below. Table 1: Description of the members of each class Description Class Member's class Student name Student's name. A constructor. Accessor and mutator to the attribute. Studen(...) getNamel and sotName (...) 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. Merceei.... A constructor assignmensos...) To assign a mentor to mentee. displayinio ) To display the mentee's information including: name and level, his her mentor's details depending the type of the mentor, i.e. either a coach mentor or a support mentor. If no mentor is assigned yet, then this method will print a message indicating that. + class Mentor coa Mentor's cpa. Menteri...! A constructor. edit) To edit mentor information by the user. print) To print the mentor's name and cpa. class Coach expertise The mentor's area of expertise that he or she can be coaching, e.g., "C++ Programming", "Game Programming", etc. A constructor. Accessor and mutator to the attribute. getExpertise and setExpertise (...) cdit To edit mentor's expertise by the user. print!) To print the mentor's name, spa and expertise. The mentor's phone number. class Support phone Suppor...... getPhone:) and selPhone: ...) A constructor Accessor and mutator to the attribute. edi. To edit mentor's phone number by the user. print To print the mentor's name, cpa and phone. Based on the class diagram in Figure 1 and specifications in Table 1, answer the questions (a) to (c) below. Note: As for questions 1 and 2, write your answers in a separate text file. Indicate the question numbers in your answers. 1. Determine the type of relationship formed between the following classes: a. Mentee and Student b. Melee and Mentor c. Coach and Men..o d. Coach and Student. e. Coach and Mensce 2. Analyse the class diagram in Figure 1 and its description in Table 1 as well as the program's output in Figure 2. Same TWO (2) methods that later in the the code, will be declared as virtual. Justify your answers. 3. Finally, implement the class diagram by modifying code in exercise3.cpp. Complete the following tasks in the program. Your code must follow the class diagram. a. Task 1. Delcare all the classes based on the class diagram. b. Task 2: Define all methods for the class Mensos 0. Task 3: Define all methods for the class Ccach d. Task 4: Define all methods for the class Support e Task 5: Define all methods for the class Men-ee f. Task 6: In the main function, an array of mentees and two mentors have been created. Complete the remaining tasks. Scc Task 6(a) to (h) in the program. Output: The program should produce the output as shown in Figure 2. Note that, bold texts indicate user inputs. Screen 1: Displaying the current mentor. Mcal Select fiat martor 2. Select secora encor 8. Display selected mentor 4. Edit selected encor 5. Assign se ectea mentor to mentee 6. Unass-91. mer.Lor Eron menlee 7. Esplay all meatcez 9. Exil Choose an operation. [1-7, 00 9] => 3 Current seledled nenor: Ahad Kanal mentor) is the current mentor Screen 2: Assigning the current mentor to the first and second mentees (i.e index 0 and 1). Menn 1. Select first mertor 2. Select second menzor 3. Display selected mentor 4. Edil selecled nenor 5. Assign se_ectes mentor to rentee 6. Unase gr. mer.tor Erem mentes 7. Display al menlees 9. Ezit Choose an operatior. 11-7, O 91 => 5 Enter the index of mentee to assign with the current merror => 0 The menu is not included here for brevity Choose an opezatior. 11-7, or 9) => 5 Enter the index of mentee to assign with the current mentor => 1 Screen 3: Displaying the mentee list. The menu is not included here for brevity Choose an operatior. 11-7, O9] => 7 List of mertoes: # Mentee'a Nama : Abdul Samas Mentee's Level : 2 Mentoring tyna : Coach-based Mentor's Name : Ahmad Kamal Melor', CBA : 3.87 Mentor's Expertise : Programming #2 Mentce's Nams : Nursiana Menteel Level : 1 Mentoring type : Coach-based Mentor's Name : Ahmad Kamal Mentor's CPA Mentor's Expertise : Programming #3 Mentee's Name : Nuraz ar Ment.ee'a level : ** No menzor yet The last menee has yet to be assigned with a mentor Screen 4: Changing the current mentor to another and assigning it to the last mentee (index 2). 8 ========== Men ========== 1. Select first mer.Lor 2. Select secara mencer 3. Display zelec od mentor 2. hdit selected mentor 5. Assign sciected mentor torrentoc 6. Urass-gr mertor from rentae 7. Display a'l menteea 9. Exit Choose an operalior. [1-7, ou 9] => 2 Second mentor is se ested The mem is not included here for brevity> Choose an operatior. 11-7, or 9] => 5 Enter the index of mentee to assign with the current mertor => 2 Choose an operation 11-7,0 91 => 7 List of mer.Lees: # Meatee's Name : Abdul Samad Menteala Taval Mentoring type : Jaach-based Mentorla Name Ahmad Kamal Mentor'e CPA Mentor's Expertise : Programming Melele Name : Nurdiana Ment.ee's level : 1 Mentoring type : aach-based Mentor's Name : Ahmad Kamal Mentor's CPA Mentor's Expertise : Programming +3 Meldete Name : Nuraz_ar. Mentoo's Lovel : 2 Mentoring type: Support-based Mentor's Name : Siti Amirah Mentor's CPA Mentor's Phone : 0123456789 The last mentee now has a mentor 9 Screen 5: Changing the expertise info of the first mentor (.e., nen-crl) and the phone number for the second mentor (i.e. nentor2). Mau Select. fiat: marto 2. Select gecord yoncer 3. Display selected mentor 4. hdit, selected mencer 5. Assign se_ectea mentor to rentee 6. Urave gr. rer.lor from renlee 7. Display a__ menteee 9. Exil Choose an operation 11-7, o 9] => 1 Firsl nen.or is selecled The menu is nol included here for brevily> Choose an operatior [1-7, or 9] => 4 Mentor's Information: Mentoring type Coach-based Melor', Nane : Ahmad Karal Mentor'. CPA Mentor Expertise : Programming Current mentor is mentori (a coach mentor). Thus, editing will be on coach data. You can only cdi- the mentor's expertise Enter new experlize -> Mobile and Web Programming Choose an operatior. 11-7, or 9] => 2 Second mentor is c'ested The menu is not included here for brevity Choose an operatior. 11-7, or 9] => 4 Mentor's Informacion: Meiloring Lype : Support-based Mentor's Namo : Siti Amirah Meator'CPA : 3.98 Mentior's hone: 0123456789 Curent mentor is changed to mentor2 (a support-mentor). Thus, editing will be on support- mentor dota. You can only edi. the mentor's phone numbe" Enter new phone nucber => +6013-89001000 7 Liot of mertee 3: 10 Mentee's Nane : Abdul Samad Meantee's Level : 2 Mentoring type : Coach-based Mentor's Namc : Ahmad karral Mentor's CPA : 3.87 Mentor's Expertise : Mobile ard web Programming Here, the mentor's expertise has changed accordingly #2 Mentee's Name : Nurciana Melody Level : 1 Mentoring type : Coacl.-based Meator's Neno : Ahmad Karcal Mentor's CPA Mentor's Expertise : Mobile and web Programming Here, the mentor's expertise has changed accordingly. #3 Mentee's Name : Nuraz_ar Me.lee Level : 2 Mentoring type : Support-cased Mentor's Name : Sili Ardir.ah |-lepr's CF Mentor's Phone : 601 3-89001000 Here, the mentor's phone number has } changed accordingly Screen 6: Removing the mentor from cond mentee (i.e., 6 Enter the index of mentee to remove its rento" => 1 Choose an operatior. 11-?, OH 91 => 7 ri 1 List of monteca: #1 : Abdul Samad Mentee's Sevel : 2 Mentoring ye : Coach-based Mentor's Nama : Ahmad Kamal Mentor's CIA Mentor's Expertise : Mobile ad heb Programming : 3.37 #2 Menta', Nane Ndiana Montec's ovel : 1 ** NO mencor yet This mentee now does not have a mentor: #3 Mentee's Name ; Nurazlan Menteels evel 2 Mentoring -yoe : Suppor--based Mentor's Name : Sit! Brinat Mentor's CPA : 3. SS Mentor's Phone: +60 3-89CC-003 Figure 2: Program output