Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

The Computer Science Department is evaluating 5 professors to see which professor has the highest rating according to student input. You will create a ProfessorRating

The Computer Science Department is evaluating 5 professors to see which professor has the highest rating according to student input. You will create a ProfessorRating class consisting of professor name and four ratings. The ratings are used to evaluate Easiness, Helpfulness, Friendliness and Clarity. The value for each rating is in the range of 1 to 5, with 1 is the lowest and 5 is the highest. Your program should contain the following functionality: a. Create a class named ProfessorRating with 5 data members: profName with string type and Easiness, Helpfulness, Friendliness and Clarity with int type b. Your class should contain the following methods: 1. constructor which initializes the private data members 2. double calcRating() returns the average rating ((easiness+helpfulness+friendliness+clarity)/4.0) 3. void print() displays the professor name and his/her rating. 4. void setData(string name, int easy, int help, int friendly, int clear) assigns parameter value to each private data member. c. Create your class in a header file (ProfessorRating.h) with the above structures. Test your class with user interface in your main program. (** make sure to include your class in your main program) #include ProfessorRating.h d. In your main program, create a vector of ProfessorRating which holds a list of 5 professor ratings. const int NUM_PROFESSORS=5; vector csProfs(NUM_PROFESSORS); e. Create a function to fill the vector with professor names and each rating. You can either create a menu to prompt the user to enter professor names and ratings for each then call the function or hardcode the values in this function. void fillProfList(vector profList) f. Create a generic function to get each rating. Call this function when populating the professors information above. int getRating(string ratingType), where ratingType is passed into the function to indicate either Easiness, Helpfulness, Friendliness or Clarity that you like to prompt to the user so they can enter proper rating. You will call this function 4 times to get each rating. g. Create a function to locate the professors with the highest and lowest average rating and display the name and rating of the professors. Call the function from your main() program to output the information. void displayHighestandLowestRating(vector profList) h. Create a display function to show the average of ALL ratings of the professors using the classs calcRating() function. Call this display function from your main() program to output the information. void displayAverageRating(vector profList)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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