Question: I need some help with these Java programs, thank you. 1 . Create an abstract class Employee and subclass Salary Employee and Hourly Employee that

I need some help with these Java programs, thank you.

I need some help with these Java programs, thank you. 1 .Create an abstract class Employee and subclass Salary Employee and Hourly Employee

1 . Create an abstract class Employee and subclass Salary Employee and Hourly Employee that inherit from Employee based on the following UML diagram :" fullName : String* get Biweekly Pay ( ) : double* getFullName : String* setFullName ( full Name : String ) : void print Bi Weekly Pay ( ) : void `omg^ ^ ^`VEE salary : double* hourly Rate : double* getBiweekly Pay ( ) _ double* get Biweekly Pay ( ) : double* getsalary ( ) : double* getHourly Rate ( ) : double* setSalary ( salary : double ) = void set Hourly Rate ( hourly Rate : double ) : void* Employee class has one abstract method get Biweekly Pay ( ) . Salary Employee override this method by calculating the bi- weekly pay as follows : salary 152* 2 ( We assume a salary employee works 52 weeks a year . ) Hourly Employee override this method by calculating the bi- weekly pay as follows :" hourly Rate* hours PerWeek* 2 :1 2 . Compile all 3 classes and make sure that you don't have any compile time errors .3 . Create a class called TestEmployee . Define an Array List that holds a list of Employees . Define a print ( ) method that will take an Array List of Employee* objects and call the print BiWeekly Pay ( method on all Employee objects in the Arraylist . Below is the code snippet of my main ( ) method : java . Util . Array List employees = new java . Util . Array List ( ) ; Salary Employee john = new Salary Employee ( ) ; john . setFull Name ( " John Doe " ) ; john . setSalary ( 50000 . 00 ) ; employees . add ( john ); Hourly Employee bob = new Hourly Employee ( ) ; bob . setFull Name ( " Bob Smith " ) ; bob . setHourly Rate ( 15 . 00 ) ; bob . set Hours Per Week ( 20 . 00 ) ;] employees . add ( bob ) ;` print ( employees ) ; "/ You need to define that in your TestEmployee program ." When I run my TestEmployee program , I have the following output :" COLLEGEON`NOT` E STEVE THESE BILLS TOMEE {`` \\ @VEE JOHN DOE { `` WEEKLY` BEMY TEE TREES_ OF GEES`FEELS 4 . Add more employees . Does not matter whether salary or hourly . Re-compile your program and run it again . You should see different output . Notice that you don't have to change your print ( ) method at all . It does not care whether they are salary or hourly employees . It only knows they are* employees

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 Programming Questions!