Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can I get this in three classes and joptionpane, please public class Employee { private String name, number; private Date date; public Employee(String name, String

Can I get this in three classes and joptionpane, please

public class Employee { private String name, number; private Date date; public Employee(String name, String number, Date date) { setName(name); setNumber(number); setDate(date); } public void setName(String n) { name = n; } public void setNumber(String n) { number = n; // you can check the format here for correctness } public void setDate(Date d) { date = d; } public String getName() { return name; } public String getNumber() { return number; } public Date getDate() { return date; }

}

public class ProductionWorker extends Employee { private int shift; private double hourlyrate; public ProductionWorker(int shift, double hourlyrate) { setShift(shift); setHourlyPayRate(hourlyrate); } public void setShift(int s) { shift = s; } public void setHourlyPayRate(double rate) { hourlyrate = rate; } public int getShift() { return shift; } public double getHourlyPayRate() { return hourlyrate; }

}

public class ShiftSupervisor extends Employee { private double salary; private double productionBonus; public ShiftSupervisor(double salary, double bonus) { setSalary(salary); setProductionBonus(bonus); } public void setSalary(double s) { salary = s; } public void setProductionBonus(double b) { productionBonus = b; } public double getSalary() { return salary; } public double getProductionBonus() { return productionBonus; }

}

public class TeamLeader extends ProductionWorker { private double monthlyBonus; private int trainReq; private int trainAtt; public TeamLeader(double monthlyBonus, int trainingRequired, int trainingAttended) { setMonthlyBonus(monthlyBonus); setTrainingRequired(trainingRequired); setTrainingAttended(trainingAttended); } public void setMonthlyBonus(double b) { monthlyBonus = b; } public void setTrainingRequird(int t) { trainReq = t; } public void setTrainingAttended(int t) { trainAtt = t; } public void addTrainingAttended(int hours) { trainAtt += hours; } public double getMonthlyBonus() { return monthlyBonus; } public int getTrainingRequired() { return trainReq; } public int getTrainingAttended() { return trainAtt; } }

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

Recommended Textbook for

Combinatorial Testing In Cloud Computing

Authors: Wei-Tek Tsai ,Guanqiu Qi

1st Edition

9811044805, 978-9811044809

More Books

Students also viewed these Programming questions

Question

Understand the content theories of motivation.

Answered: 1 week ago