Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 isHeadNurse, 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 baseSalary with 100KD. If the nurse works more than 20 hoursiweek, 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 isHeadoDept() that increments the baseSalary 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 base Salary 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 o Print their updated salaries, Create two Doctor objects and o Print their info o Check if they are head of department o Print their updated salaries o Compare the two doctors and print which one has the highest number of publications 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 isHeadNurse, 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 baseSalary with 100KD. If the nurse works more than 20 hoursiweek, 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 isHeadoDept() that increments the baseSalary 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 base Salary 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 o Print their updated salaries, Create two Doctor objects and o Print their info o Check if they are head of department o Print their updated salaries o 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

Students also viewed these Databases questions

Question

To find integral of ?a 2 - x 2

Answered: 1 week ago

Question

To find integral of e 3x sin4x

Answered: 1 week ago

Question

To find the integral of 3x/(x - 1)(x - 2)(x - 3)

Answered: 1 week ago

Question

What are Fatty acids?

Answered: 1 week ago

Question

What are Electrophoresis?

Answered: 1 week ago

Question

What is digital literacy? Why is it necessary?

Answered: 1 week ago