Question: i. Declare the data field(s) for the class with appropriate access specifier. (4 marks) ii. Write a constructor with argument(s) for the class. (6 marks)

 i. Declare the data field(s) for the class with appropriate access

i. Declare the data field(s) for the class with appropriate access specifier. (4 marks)

ii. Write a constructor with argument(s) for the class. (6 marks)

iii. Write the getAverage() method. (6 marks)

iv. Write the getStatus() method. (7 marks)

v. Write the toString() method. (8 marks)

Q1 (a) Answer Q1(a)(i) - Q1(a)(v) based on the information given in Figure Q1(a). A class called Lecturer is developed to hold a lecturer's name and evaluation scores for three taught courses. . The class also provide the following methods: A constructor with no-argument . A constructor with argument-The constructor accepts name, and three values (as double) and stores it in the respective data fields. getAverage- The getAverage method is used to calculate and return the average evaluation score for the three courses. getStatus- The getStatus method is used to return a performance status of a lecturer based on the average evaluation score as in the following scale: Average evaluation score Performance status Greater than and equal to 4.5, but less "Excellent" than or equal to 5.0 Greater than and equal to 4.0, "Good" but less than 4.5 Greater than and equal to 3.0, but less "Average" than 4.0 Less than 3.0 "Poor" toString- returns a string that contains name, scores for the three courses, average evaluation score, and performance status. FIGURE Q1(a)

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