Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

2. Show the trainees how to do it without saying anything.

Answered: 1 week ago