h property. b. Your class should have two constructors: one that takes all properties, and one that takes only first name, last name, university name, and subject and sets both of the ratings to an appropriate default value. c. You should provide accessors (getters) and mutators (setters) for first name, last name, university name, and subject. d. Your class should provide a method to add a new rating for the professor. It should take two arguments: one for overall rating and one for level of difficulty, with values from 1 (awful) to 5 (aweso

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

You are designing an application to rate your professors.
a. Professors have the following properties: first name, last name, university
name, subject, and ratings for overall quality (1.0-5.0) and level of difficulty
(1.0-5.0). Your class should have instance variables of the appropriate
type for each property.
b. Your class should have two constructors: one that takes all properties, and
one that takes only first name, last name, university name, and subject
and sets both of the ratings to an appropriate default value.
c. You should provide accessors (getters) and mutators (setters) for first
name, last name, university name, and subject.
d. Your class should provide a method to add a new rating for the professor.
It should take two arguments: one for overall rating and one for level of
difficulty, with values from 1 (awful) to 5 (awesome). Each time a new
rating is provided, your class should calculate the average rating for the
professor and update the appropriate variable for each.
e. Your class should provide two methods to retrieve the averages for overall
rating and level of difficulty.
f. Your class should have an informative toString method.
g. Update your main method to create at least two professors and apply
several ratings to each. You should print the initial state of each professor
using your toString method as well as the change in state each time any
of the state is changed (e.g. a mutator is used to modify the subject or a
new rating is applied).

Expert Solution
Step 1

the solution is an given below :

trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
JQuery and Javascript
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education