Question: CSC110AA and CIS163AA Ch 8 Inheritance Ch 8 Program 1 HospitalEmployee Inheritance Please adhere to the Standards for Programming Assignments and the Java Code and

CSC110AA and CIS163AA Ch 8 Inheritance Ch 8 Program 1 HospitalEmployee Inheritance

Please adhere to the Standards for Programming Assignments and the Java Code and Style Guidelines. Submit the following:

List of source code with comments to document

Test output listed as comments at the end of your program

1. (10 points) Implement a Doctor class based on the UML below. The Doctor class extends/inherits the HospitalEmployee class. Download the HospitalEmployee class.

Doctor

- specialty : String //area of expertise such as Pediatrics, Surgery, Internal Medicine

+ Doctor(eName:String, eNumber : int, hours : double, pay : double, special : String) //must call super class constructor

+ getSpecialty( ) : String + setSpecialty(special : String) : void + calculateBonus(shift : String) : double /ight shift = 10%. evening shift = 5%. day shift = 0%.

//Use calculateBonus(percent) method in HospitalEmployee + createLogin() : String //create and return a login. first 2 letters of name + random number between 0-9 + employee number

+ toString( ) : String //must call super class toString

2. (10 points) Implement a tester class called Hospital. Specifically, Hospital should do the following in this order:

Create/instantiate a HospitalEmployee object called luke that has the name Luke Skywalker, an employee number of 5432, hours worked of 40 and a payrate of $20.50.

Display the status of luke using toString.

Calculate and display lukes bonus. He is a satisfactory employee.

Create/instantiate a Doctor object called darth with the name Darth Vader, and employee number of 9876, hours worked of 17, a payrate of $150.00. His specialty is Plastic Surgery.

Display the status of darth using toString.

Calculate and display darths bonus using the calculateBonus method from the Doctor class. He works the

evening shift.

Create and display Darths login.

Display the number of HospitalEmployee objects created.

Hints: Example output:

Welcome to our Hospital ======================= 

Beginning state of luke : empName: Luke Skywalker empNumber: 5432 hoursWorked: 40.0 payRate: $20.50 Luke Skywalker is a satisfactory HospitalEmployee. Bonus = $300.00.

Beginning state of darth : empName: Darth Vader empNumber: 9876 hoursWorked: 17.0 payRate: $150.00 Darth Vader is a Doctor and works the evening shift. Bonus = $127.50 Darth Vader's login is: Da39876

Number of HospitalEmployees created : 2 Goodbye 

Order of compilation: HospitalEmployee, Doctor, Hospital. All files should be in the same folder/package. You may change the visibility modifier of the HospitalEmployee instance variables to protected.

specialty: Plastic Surgery 

pbaker CSC110AA and CIS163AA Ch 8 Inheritance Ch 8 Program 1 HospitalEmployee Inheritance

Ch 8-inheritance CSC110AA and CIS 163AA Ch 8 Program HospitalEmployee inheritance Please adhere to the Standards for Programming Assignments and the Java Code and Style Guldeines. Submit the following List of source code with comm ents to Test output isted as comments at the end of your program 1. (10 points) Im e Doctor class based on the UML below. The Doctor dass extendsMrherits the plement HospitalEmployee class. Download the Ho8pital Employee casB Strin of expert se such Pediatrics, surgery, internal MedMaine speci +Doctor(eName: String, eNumber int, hours: double, pay double, special String) //must call super class constructor getSpecialty(): String setSpecialtytspeci String): void calculateBonus(shift: String) double /ight shut a 10N, evening shot a sad. dayshtra oss. Muse createLoginI): String //create and return a login, first 2letters ofname random number between 0-9 employee number toString(): String //must call super class tostring 2. (10 points Implement a tester cl called Hospital. Specifically, Hospital should do the following in this arder: createinstantiate HospitalEmployee object called ke that has the name Luke Skywalker, an employee numb Display the status of luke using toString. ate and display luke's bono He is a tisfactory employee createvinstantiate Doctor cbiect called darth with the name Darth Vader, and employee number of 9876 hours worked af 17, a payrate of S150.00. His specialty is Plastic Surgery. Display tha status of darthusing toString. Calculate and display darth's bonus using the cakulateBonus method from the Doctor class. He works the ng shift. Create and display Darth's login. Display the number of Hospital obects created. Hints; Order of compiaton: HospitalEmployee, Doctor, Hospiral, Aa fies should be in the same foiderpackage, You may chenge me visibilmy modMerof the HospitalEmployee instance variables to protected Example outp Welcome to our Hospital Luke Skywalker Number satisfactory HospitalEmployee. Bonus state of darth pecialty: Plastic surgery 17.e pay Rate: $1 $127.5a rks the evening shift login i of Hospital Employees created

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!