Question: Write a complete Java code in BlueJ that does the following: Create an interface named :SalarySystem. The interface has an abstract method named: SalaryCalc (

Write a complete Java code in BlueJ that does the following:
Create an interface named :SalarySystem.
The interface has an abstract method named: SalaryCalc() to calculate the salary of a doctor in the hospital.
Create another interface named ExcellenceAward that has an abstract method ExcellenceAwardCalc() to
calculate the allowance for Excellence Award for doctors.
Create a class named Doctor that implements both interfaces: SalarySystem and ExcellenceAward.
a. Private attributes:
name (String),
Id(int)
YearsOfExperience (int)
NumOfSurgeries (int) to store the number of surgeries performed by the doctor.
Allowance(double) to store the allowance amount the doctor get from performing surgeries
Salary (double)
b. Constructor that only accepts id and name, YearsOfExperience, and NumOfSurgeries as parameters.
Make salary and allowance fixed to 0.
c. Override SalaryCalc() method in the SalarySystem interface as follows: Salary=YearsOfExperience *2000
d. Override ExcellenceAwardCalc() method in the interface ExcellenceAward as follows: Allowance=
NumOfSurgeries*1000
Create a class named Dentist that extends the Doctor class as follows:
a. Constructor that only accepts id and name, YearsOfExperience, and NumOfSurgeries as parameters.
b. Override SalaryCalc() method in the Doctor class as follows: Salary= YearsOfExperience **1500
COMP_214/Lab_Assignment/2023-2024/Second_Semester
Manal Zakri
Create a main method inside a class called Main to do the following:
a. Create an ArrayList doctors to add 3 doctors declared by the Doctor class.
b. Create another ArrayList dentists to add 3 dentists declared by the Dentist class.
c. Call the method ExcellenceAwardCalc() and SalaryCalc() of all doctors stored in the Arraylist, and
print out the results.
d. Call the method ExcellenceAwardCalc() and SalaryCalc() of all dentists stored in the Arraylist, and
print out the results.
 Write a complete Java code in BlueJ that does the following:

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!