Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java, using netbeans 8.2 You are given the following class descriptions. Read the description carefully, implement the classes in Java, and submit your code

in java, using netbeans 8.2 image text in transcribed
You are given the following class descriptions. Read the description carefully, implement the classes in Java, and submit your code as netbeans folder: Class Person (20 points): Create an abstract class Person with the following private attributes: String fullName, String address, MyDate bday, String department, int hoursPerWeek, int basesalary. (Note: Use the same MyDate class as the one we have used in lab) Implement the toString() method that prints all the information about a Person Implement an abstract method calcSalary():int. Class Nurse (25 points): Implement class Nurse that inherits from Person. Declare the following private attribute: boolean is HeadNurse, Implement the toString method that prints all the information about a Nurse, including the inherited attributes. Implement the method isHeadNurse (that increments the baseSalary with 100KD if the nurse is a head Nurse. Implement the method calcSalary that implements and returns the total Salary of the Nurse, If the nurse is a head Nurse, increment the base Salary with 100KD. IF the nurse works more than 20 hours/week, increment the salary with another 100KD. Class Doctor (30 points): Implement class Doctor that inherits from Person. Declare the following private attributes: int publications, Boolean headOfDept. Implement the toString() method that prints all the information about a Doctor including the inherited attributes. Implement the method isHeadofDept() that increments the base Salary with 100KD if the doctor is a head of department Implement a method calcSalary that calculates and returns the totalSalary of a Doctor. If the doctor has more than 5 publications, increment the salary with 50KD for every publication. If the doctor is head of department, increment the baseSalary with another 100KD. Implement method compareTo(Doctor d) that compares and returns the doctor with the hightest nr of publciatons Class MyMain (25 points) In the main method create two Nurse objects and : o Print their info Check if they are head nurses Print their updated salaries. Create two Doctor objects and o Print their info o Check if they are head of department Print their updated salaries Compare the two doctors and print which one has the highest number of publications

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

Which of the following is a type of output?

Answered: 1 week ago

Question

Are the short-term results outweighed by a long-term backlash?

Answered: 1 week ago