Question: Create a class Professor The class must have constructor to initialize the following attributes profID - Professor ID - Integer valueprofName - Professor Name -

Create a class Professor
The class must have constructor to initialize the following attributes
profID- Professor ID - Integer valueprofName - Professor Name - StringsubDict - Subject Dictionary - Dictionary with Subject Name as keys and the number of years the professor has experience in that subject
----------------------------------------------------------------------------------------------------------------
Create a class University
The class must implement two functions namely
getTotalExperience()selectSeniorProfessorBySubject()
Function Explanations
1. getTotalExperience()
Input:
prof_list- List of Professor Class Objects
prof_id- Professor ID
Output:
total - Integer - Total experience of the professor
STEPS
The function must loop through the prof_list and must find the total experience of the professor object whose ID is equal to theparameter professor ID as reference
Hint1: Total experience is the sum of all the years of experience that the professor has invarious subjects
Hint2: Write the logic to sum all the values of Dictionary subDict to find the total experience of the specific Professor.
---------------------------------------------------------------------------------------------------------------------------
2.selectSeniorProfessorBySubject()
Input:
prof_list- List of Professor Class Objects
sub_name-String- Subject Name
Output:
result- Object of Professor Class
STEPS
The function must find the Professor object who is seniorin the subject (sub_name passed in parameter)among all the professors in the University
Hint1: Function must loop through prof_list. In each iteration (i.e for each Professor Object)it must find the yearsof experience , the professor has in that particular Subject by checking it in the dictionary sub_Dict
Hint2: After comparing each, the Professor class object who has the maximum years of experience must be returned from function by storing it in"result" variable.

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 Programming Questions!