Question: Please help me code the following in: JAVA Please use many COMMENTS and read the task THOROUGHLY! Full points will be awarded, thanks in advance!
Please help me code the following in: JAVA
Please use many COMMENTS and read the task THOROUGHLY!
Full points will be awarded, thanks in advance! 
Employee class: public class Employee implements java.io.Serializable { public String name; public String address; public transient int SSN; public int number; public void mailCheck() { System.out.println("Mailing a check to " + name + " " + address); } } HourlyWorker class:
/*
* HourlyWorker.java
* This worker calculates her weekly pay differently than a salaried worker does, so we override the calculateWeeklyPay method
*/
public class HourlyWorker extends Employee {
private double hourlyPay;
public static final double MINIMUM_WAGE = 10.0;
public HourlyWorker() {
super();
}
public HourlyWorker(String name, int social) {
super(name, social);
hourlyPay = MINIMUM_WAGE;
}
public HourlyWorker(String name, int social, double pay) {
super(name, social);
if( pay > 0.0) {
hourlyPay = pay;
}
}
/otice how we override this method to act accordingly for an hourly wage
public double calculateWeeklyPay() {
return hourlyPay * 40;
}
}
SalariedWorker class:
/*
* SalariedWorker.java
* This worker calculates her weekly pay differently than a hourly worker does, so we override the calculateWeeklyPay method
*/
public class SalariedWorker extends Employee {
private double monthlyPay;
public SalariedWorker() {
super();
}
public SalariedWorker(String name, int social) {
super(name, social);
}
public SalariedWorker(String name, int social, double pay) {
super(name, social);
if( pay > 0.0) {
monthlyPay = pay;
}
}
public double calculateWeeklyPay() {
return monthlyPay/4;
}
} Accountant class:
public class Accountant extends SalariedWorker {
public static final double ACCOUNTANT_MONTHLY = 8000;
private Accountant() {//private blocks this object from being created this way
}
//the only way to make an Accountant is to specify the name and social, or with the other constructor below that takes name, social, and pay
public Accountant(String name, int social){
super(name, social, ACCOUNTANT_MONTHLY );
}
public Accountant(String name, int social, double monthlyPay) {
super(name, social, monthlyPay);
}
}
Window Extends JFrame For this demonstration, view the Window.java file example to learn how to produce your own GUI by extending the existing JFrame class. This is defined pictorially above in the example inheritance hierarchies. We will use this feature in future labs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
