Question: Java hospital employee and hospital classes. Need Help, I do not know where to start. I am just at a lost. Implement a class called
Java hospital employee and hospital classes.
Need Help, I do not know where to start. I am just at a lost.
Implement a class called HospitalEmployee that represents an employee in a hospital based on the following informal UML diagram. Adhere to the UML diagram. Do not add additional instance variables or methods. private String empName private int empNumber private double hoursWorked private double payRate public Hospital Employee ()//default constructor. Assigns instance variables a default value.//e,ployee to your name, empNumber to 9999, hoursWorked to 0, payRate to 0 public String getEmpName() public//returns the employee's name int getEmpNumber() public double//returns the employee's n getHours Worked() public double//returns the hours an employee worked getPay Rate()//returns the employee's pay rate public void setEmpName (String ename)//sets the name for this employee public void setEmpNumber(int enumber)//sets the employee number for this employee public void setHoursWorked(double hours)//sets the hours worked for this employee public void setPayRate(double rate)//sets the pay rate for this employee public double calculateGrossPay()//calculates and returns the employee's gross pay (hours worked * pay rate) public void changeHoursworked (double hours)//changes the instance variable hoursWarked by the hours//hours Worked should be updated to hoursWorked + hours The output from running Hospital should be as follows: (of course, your output will use your actual name) public void changePayRate(double amount)//changes the instance variable payRate by the amount Welcome to our Hospital//payRate should be updated to payRate + amount public double calculateBonus(String rating)//returns 500 if rating is "excellent"//returns 300 if rating is "satisfactory"//All other ratings return 0 public String to String()//returns the current state of this as a String//current values of all instance variables is called the current state) Implement a tester class called Hospital. java to test (or use) methods in the HospitalEmployee class. This file is also called a controller or driver program. Hospital should do the following in this order.//create a HospitalEmployee called worker1//display the state of object worker1 using the toString method//set the pay rate of worker1 to 20.00 u the setPayRate method//display the state of objec worker1 using the toString method//change/increase the pay rate of worker1 by 4.50 using the changePayRate method//change/increase the hours worked off worker1 by 30 using the changeHoursWorked method//display the state of worker1 using the toString method//display the name and gross pay of worker1 using getEmpName and calculateGrossPay methods.//calculate a bonus for worker1 using the calculateBonus method. worker1 is an excellent employee.//display the name, bonus, and total earnings of worker1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
