Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Idint
YearsOfExperience int
NumOfSurgeries int to store the number of surgeries performed by the doctor.
Allowancedouble 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
c Override SalaryCalc method in the SalarySystem interface as follows: SalaryYearsOfExperience
d Override ExcellenceAwardCalc method in the interface ExcellenceAward as follows: Allowance
NumOfSurgeries
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
COMPLabAssignmentSecondSemester
Manal Zakri
Create a main method inside a class called Main to do the following:
a Create an ArrayList doctors to add doctors declared by the Doctor class.
b Create another ArrayList dentists to add 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.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started