SlideShare a Scribd company logo
1 of 17
Download to read offline
package employeeType.employee;
public class Employee {
private String firstName;
private String lastName;
private char middleInitial;
private boolean fulltime;
private char gender;
private int employeeNum;
public Employee(String firstName, String lastName, char middleInitial,
char gender, int employeeNum, boolean fulltime) {
super();
this.firstName = firstName;
this.lastName = lastName;
this.middleInitial = middleInitial;
this.fulltime = fulltime;
this.gender = gender;
this.employeeNum = employeeNum;
}
public int getEmployeeNumber() {
return this.employeeNum;
}
public void setEmployeeNumber(int empNum) {
this.employeeNum = empNum;
}
public String getFirstName() {
return firstName;
}
String getLastName() {
return lastName;
}
char getMiddleInitial() {
return middleInitial;
}
public char getGender() {
return gender;
}
public void setFirstName(String fn) {
this.firstName = fn;
}
public void setLastName(String ln) {
this.lastName = ln;
}
public void setMiddleI(char m) {
this.middleInitial = m;
}
public void setGender(char g) {
this.gender = g;
}
public boolean equals(Object obj) {
// TODO Auto-generated method stub
if (obj instanceof Employee) {
Employee employee = (Employee) obj;
if (employee.getEmployeeNumber() == this.getEmployeeNumber())
return true;
else
return false;
} else
return false;
}
public String toString() {
// TODO Auto-generated method stub
return getEmployeeNumber() + " " + getFirstName() + " "
+ getLastName() + " Gender:" + getGender() + " Status:"
+ ((fulltime) ? "Full Time" : "Part Time");
}
}
package employeeType.subTypes;
import java.text.DecimalFormat;
import employeeType.employee.Employee;
public class HourlyEmployee extends Employee {
private double wage;
private double hoursWorked;
public HourlyEmployee(String firstName, String lastName,
char middleInitial, char gender, int employeeNum, boolean fulltime,
double wage) {
super(firstName, lastName, middleInitial, gender, employeeNum, fulltime);
// TODO Auto-generated constructor stub
this.wage = wage;
this.hoursWorked = 0.0d;
}
public void increaseHours(double hours) {
if (hours > 0)
this.hoursWorked += hours;
else
System.out.println("Error! Invalid hours");
}
public String toString() {
// TODO Auto-generated method stub
return super.toString() + " Wage: " + wage + " Hours Worked: "
+ hoursWorked;
}
public double calculateWeeklyPay() {
double pay;
if (hoursWorked > 40) {
pay = (40 * wage) + (2 * (hoursWorked - 40) * wage);
} else {
pay = wage * hoursWorked;
}
return pay;
}
public void annualRaise() {
DecimalFormat decimalFormat = new DecimalFormat("#.##");
wage = Double.valueOf(decimalFormat.format(wage * 0.05));
}
public double holidayBonus() {
return 40 * wage;
}
public void resetWeek() {
this.hoursWorked = 0;
}
}
package employeeType.subTypes;
import java.text.DecimalFormat;
import employeeType.employee.Employee;
public class SalaryEmployee extends Employee {
double salary;
public SalaryEmployee(String firstName, String lastName,
char middleInitial, char gender, int employeeNum, boolean fulltime,
double s) {
super(firstName, lastName, middleInitial, gender, employeeNum, fulltime);
// TODO Auto-generated constructor stub
this.salary = s;
}
public String toString() {
// TODO Auto-generated method stub
return super.toString() + " Salary:" + salary;
}
public double calculateWeeklyPay() {
return salary / 52.00d;
}
public void annualRaise() {
DecimalFormat decimalFormat = new DecimalFormat("#.##");
salary = Double.valueOf(decimalFormat.format(salary * 0.06));
}
public double holidayBonus() {
return salary * 0.03;
}
public void resetWeek() {
}
}
package employeeType.subTypes;
import employeeType.employee.Employee;
public class CommissionEmployee extends Employee {
double sales;
double rate;
public CommissionEmployee(String firstName, String lastName,
char middleInitial, char gender, int employeeNum, boolean fulltime,
double r) {
super(firstName, lastName, middleInitial, gender, employeeNum, fulltime);
// TODO Auto-generated constructor stub
this.rate = r;
this.sales = 0.0d;
}
public String toString() {
// TODO Auto-generated method stub
return super.toString() + " Rate: " + rate + " Sales: " + sales;
}
public void increaseSales(double sales) {
if (sales > 0)
this.sales += sales;
else
System.out.println("Error! Not valid sales");
}
public double calculateWeeklyPay() {
return sales * rate / 100;
}
public void annualRaise() {
this.rate += 0.02;
}
public double holidayBonus() {
return 0.00d;
}
public void resetWeek() {
this.sales = 0.0d;
}
}
import employeeType.subTypes.CommissionEmployee;
import employeeType.subTypes.HourlyEmployee;
import employeeType.subTypes.SalaryEmployee;
public class EmployeeTest {
public static void main(String args[]) {
// Create references for our objects
HourlyEmployee hourly;
SalaryEmployee salary;
CommissionEmployee commission;
// The sum of all bonuses will be placed here
double bonusPayout = 0;
// Create and print a new HourlyEmployee
hourly = HourlyFactory();
System.out.printf(" %s ", hourly);
// Create and print a new SalaryEmployee
salary = SalaryFactory();
System.out.printf(" %s ", salary);
// Create and print a new CommissionEmployee
commission = CommissionFactory();
System.out.printf(" %s ", commission);
// Alter some values of Hourly and Commission
System.out.println("Increasing Hourly's hours worked by 50.");
hourly.increaseHours(50);
System.out.println("Increasing Commissions's sales by 150,000. ");
commission.increaseSales(150000);
// Output weekly pay for each Employee
System.out.printf("Hourly Payout: %.2f ", hourly.calculateWeeklyPay());
System.out.printf("Salary Payout: %.2f ", salary.calculateWeeklyPay());
System.out.printf("Commission Payout: %.2f  ",
commission.calculateWeeklyPay());
// Find total bonus payout
System.out.println("Finding total bonus payout...");
bonusPayout += hourly.holidayBonus();
bonusPayout += salary.holidayBonus();
bonusPayout += commission.holidayBonus();
System.out.printf("Bonus Payout is %.2f  ", bonusPayout);
// Reset the week and apply raises to all Employees
System.out.println("Applying annual raises and resetting week...");
hourly.resetWeek();
hourly.annualRaise();
salary.resetWeek();
salary.annualRaise();
commission.resetWeek();
commission.annualRaise();
// Output Employees after changes
System.out.printf("%s %s %s ", hourly, salary, commission);
}
// Retrieve input and create HourlyEmployee
public static HourlyEmployee HourlyFactory() {
System.out.println("Creating HourlyEmployee...");
return new HourlyEmployee("Steve", "Rogers", 'A', 'M', 12345, true,
15.34);
}
// Retrieve input and create SalaryEmployee
public static SalaryEmployee SalaryFactory() {
System.out.println("Creating SalaryEmployee...");
return new SalaryEmployee("Kitty", "Pryde", 'X', 'F', 54321, true,
75000);
}
// Retrieve input and create CommissionEmployee
public static CommissionEmployee CommissionFactory() {
System.out.println("Creating CommissionEmployee...");
return new CommissionEmployee("Johnny", "Storm", 'F', 'L', 976499,
false, 2.5);
}
}
OUTPUT:
Creating HourlyEmployee...
12345
Steve Rogers
Gender:M
Status:Full Time
Wage: 15.34
Hours Worked: 0.0
Creating SalaryEmployee...
54321
Kitty Pryde
Gender:F
Status:Full Time
Salary:75000.0
Creating CommissionEmployee...
976499
Johnny Storm
Gender:L
Status:Part Time
Rate: 2.5
Sales: 0.0
Increasing Hourly's hours worked by 50.
Increasing Commissions's sales by 150,000.
Hourly Payout: 920.40
Salary Payout: 1442.31
Commission Payout: 3750.00
Finding total bonus payout...
Bonus Payout is 2863.60
Applying annual raises and resetting week...
12345
Steve Rogers
Gender:M
Status:Full Time
Wage: 0.77
Hours Worked: 0.0
54321
Kitty Pryde
Gender:F
Status:Full Time
Salary:4500.0
976499
Johnny Storm
Gender:L
Status:Part Time
Rate: 2.52
Sales: 0.0
Solution
package employeeType.employee;
public class Employee {
private String firstName;
private String lastName;
private char middleInitial;
private boolean fulltime;
private char gender;
private int employeeNum;
public Employee(String firstName, String lastName, char middleInitial,
char gender, int employeeNum, boolean fulltime) {
super();
this.firstName = firstName;
this.lastName = lastName;
this.middleInitial = middleInitial;
this.fulltime = fulltime;
this.gender = gender;
this.employeeNum = employeeNum;
}
public int getEmployeeNumber() {
return this.employeeNum;
}
public void setEmployeeNumber(int empNum) {
this.employeeNum = empNum;
}
public String getFirstName() {
return firstName;
}
String getLastName() {
return lastName;
}
char getMiddleInitial() {
return middleInitial;
}
public char getGender() {
return gender;
}
public void setFirstName(String fn) {
this.firstName = fn;
}
public void setLastName(String ln) {
this.lastName = ln;
}
public void setMiddleI(char m) {
this.middleInitial = m;
}
public void setGender(char g) {
this.gender = g;
}
public boolean equals(Object obj) {
// TODO Auto-generated method stub
if (obj instanceof Employee) {
Employee employee = (Employee) obj;
if (employee.getEmployeeNumber() == this.getEmployeeNumber())
return true;
else
return false;
} else
return false;
}
public String toString() {
// TODO Auto-generated method stub
return getEmployeeNumber() + " " + getFirstName() + " "
+ getLastName() + " Gender:" + getGender() + " Status:"
+ ((fulltime) ? "Full Time" : "Part Time");
}
}
package employeeType.subTypes;
import java.text.DecimalFormat;
import employeeType.employee.Employee;
public class HourlyEmployee extends Employee {
private double wage;
private double hoursWorked;
public HourlyEmployee(String firstName, String lastName,
char middleInitial, char gender, int employeeNum, boolean fulltime,
double wage) {
super(firstName, lastName, middleInitial, gender, employeeNum, fulltime);
// TODO Auto-generated constructor stub
this.wage = wage;
this.hoursWorked = 0.0d;
}
public void increaseHours(double hours) {
if (hours > 0)
this.hoursWorked += hours;
else
System.out.println("Error! Invalid hours");
}
public String toString() {
// TODO Auto-generated method stub
return super.toString() + " Wage: " + wage + " Hours Worked: "
+ hoursWorked;
}
public double calculateWeeklyPay() {
double pay;
if (hoursWorked > 40) {
pay = (40 * wage) + (2 * (hoursWorked - 40) * wage);
} else {
pay = wage * hoursWorked;
}
return pay;
}
public void annualRaise() {
DecimalFormat decimalFormat = new DecimalFormat("#.##");
wage = Double.valueOf(decimalFormat.format(wage * 0.05));
}
public double holidayBonus() {
return 40 * wage;
}
public void resetWeek() {
this.hoursWorked = 0;
}
}
package employeeType.subTypes;
import java.text.DecimalFormat;
import employeeType.employee.Employee;
public class SalaryEmployee extends Employee {
double salary;
public SalaryEmployee(String firstName, String lastName,
char middleInitial, char gender, int employeeNum, boolean fulltime,
double s) {
super(firstName, lastName, middleInitial, gender, employeeNum, fulltime);
// TODO Auto-generated constructor stub
this.salary = s;
}
public String toString() {
// TODO Auto-generated method stub
return super.toString() + " Salary:" + salary;
}
public double calculateWeeklyPay() {
return salary / 52.00d;
}
public void annualRaise() {
DecimalFormat decimalFormat = new DecimalFormat("#.##");
salary = Double.valueOf(decimalFormat.format(salary * 0.06));
}
public double holidayBonus() {
return salary * 0.03;
}
public void resetWeek() {
}
}
package employeeType.subTypes;
import employeeType.employee.Employee;
public class CommissionEmployee extends Employee {
double sales;
double rate;
public CommissionEmployee(String firstName, String lastName,
char middleInitial, char gender, int employeeNum, boolean fulltime,
double r) {
super(firstName, lastName, middleInitial, gender, employeeNum, fulltime);
// TODO Auto-generated constructor stub
this.rate = r;
this.sales = 0.0d;
}
public String toString() {
// TODO Auto-generated method stub
return super.toString() + " Rate: " + rate + " Sales: " + sales;
}
public void increaseSales(double sales) {
if (sales > 0)
this.sales += sales;
else
System.out.println("Error! Not valid sales");
}
public double calculateWeeklyPay() {
return sales * rate / 100;
}
public void annualRaise() {
this.rate += 0.02;
}
public double holidayBonus() {
return 0.00d;
}
public void resetWeek() {
this.sales = 0.0d;
}
}
import employeeType.subTypes.CommissionEmployee;
import employeeType.subTypes.HourlyEmployee;
import employeeType.subTypes.SalaryEmployee;
public class EmployeeTest {
public static void main(String args[]) {
// Create references for our objects
HourlyEmployee hourly;
SalaryEmployee salary;
CommissionEmployee commission;
// The sum of all bonuses will be placed here
double bonusPayout = 0;
// Create and print a new HourlyEmployee
hourly = HourlyFactory();
System.out.printf(" %s ", hourly);
// Create and print a new SalaryEmployee
salary = SalaryFactory();
System.out.printf(" %s ", salary);
// Create and print a new CommissionEmployee
commission = CommissionFactory();
System.out.printf(" %s ", commission);
// Alter some values of Hourly and Commission
System.out.println("Increasing Hourly's hours worked by 50.");
hourly.increaseHours(50);
System.out.println("Increasing Commissions's sales by 150,000. ");
commission.increaseSales(150000);
// Output weekly pay for each Employee
System.out.printf("Hourly Payout: %.2f ", hourly.calculateWeeklyPay());
System.out.printf("Salary Payout: %.2f ", salary.calculateWeeklyPay());
System.out.printf("Commission Payout: %.2f  ",
commission.calculateWeeklyPay());
// Find total bonus payout
System.out.println("Finding total bonus payout...");
bonusPayout += hourly.holidayBonus();
bonusPayout += salary.holidayBonus();
bonusPayout += commission.holidayBonus();
System.out.printf("Bonus Payout is %.2f  ", bonusPayout);
// Reset the week and apply raises to all Employees
System.out.println("Applying annual raises and resetting week...");
hourly.resetWeek();
hourly.annualRaise();
salary.resetWeek();
salary.annualRaise();
commission.resetWeek();
commission.annualRaise();
// Output Employees after changes
System.out.printf("%s %s %s ", hourly, salary, commission);
}
// Retrieve input and create HourlyEmployee
public static HourlyEmployee HourlyFactory() {
System.out.println("Creating HourlyEmployee...");
return new HourlyEmployee("Steve", "Rogers", 'A', 'M', 12345, true,
15.34);
}
// Retrieve input and create SalaryEmployee
public static SalaryEmployee SalaryFactory() {
System.out.println("Creating SalaryEmployee...");
return new SalaryEmployee("Kitty", "Pryde", 'X', 'F', 54321, true,
75000);
}
// Retrieve input and create CommissionEmployee
public static CommissionEmployee CommissionFactory() {
System.out.println("Creating CommissionEmployee...");
return new CommissionEmployee("Johnny", "Storm", 'F', 'L', 976499,
false, 2.5);
}
}
OUTPUT:
Creating HourlyEmployee...
12345
Steve Rogers
Gender:M
Status:Full Time
Wage: 15.34
Hours Worked: 0.0
Creating SalaryEmployee...
54321
Kitty Pryde
Gender:F
Status:Full Time
Salary:75000.0
Creating CommissionEmployee...
976499
Johnny Storm
Gender:L
Status:Part Time
Rate: 2.5
Sales: 0.0
Increasing Hourly's hours worked by 50.
Increasing Commissions's sales by 150,000.
Hourly Payout: 920.40
Salary Payout: 1442.31
Commission Payout: 3750.00
Finding total bonus payout...
Bonus Payout is 2863.60
Applying annual raises and resetting week...
12345
Steve Rogers
Gender:M
Status:Full Time
Wage: 0.77
Hours Worked: 0.0
54321
Kitty Pryde
Gender:F
Status:Full Time
Salary:4500.0
976499
Johnny Storm
Gender:L
Status:Part Time
Rate: 2.52
Sales: 0.0

More Related Content

Similar to package employeeType.employee;public class Employee {   private .pdf

maJavaProjectFinalExam.classpathmaJavaProjectFinalExam.p.docx
maJavaProjectFinalExam.classpathmaJavaProjectFinalExam.p.docxmaJavaProjectFinalExam.classpathmaJavaProjectFinalExam.p.docx
maJavaProjectFinalExam.classpathmaJavaProjectFinalExam.p.docxinfantsuk
 
import java.io.-WPS Office.docx
import java.io.-WPS Office.docximport java.io.-WPS Office.docx
import java.io.-WPS Office.docxKatecate1
 
Create a C# applicationYou are to create a class object called “Em.pdf
Create a C# applicationYou are to create a class object called “Em.pdfCreate a C# applicationYou are to create a class object called “Em.pdf
Create a C# applicationYou are to create a class object called “Em.pdffeelingspaldi
 
define a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdfdefine a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdffashioncollection2
 
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdfThe solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdfaparnatiwari291
 
@author public class Person{   String sname, .pdf
  @author   public class Person{   String sname, .pdf  @author   public class Person{   String sname, .pdf
@author public class Person{   String sname, .pdfaplolomedicalstoremr
 
Hi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdfHi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdffashioncollection2
 
Designing Immutability Data Flows in Ember
Designing Immutability Data Flows in EmberDesigning Immutability Data Flows in Ember
Designing Immutability Data Flows in EmberJorge Lainfiesta
 
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdfoperating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdfarasanmobiles
 
source-code-program-menghitung-gaji-pegawai
source-code-program-menghitung-gaji-pegawaisource-code-program-menghitung-gaji-pegawai
source-code-program-menghitung-gaji-pegawaiKang Fatur
 
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBTDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBtdc-globalcode
 
import java.util.Random;defines the Stock class public class S.pdf
import java.util.Random;defines the Stock class public class S.pdfimport java.util.Random;defines the Stock class public class S.pdf
import java.util.Random;defines the Stock class public class S.pdfaquazac
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdflakshmijewellery
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo....NET Conf UY
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfrajkumarm401
 
C# Programming. Using methods to call results to display. The code i.pdf
C# Programming. Using methods to call results to display. The code i.pdfC# Programming. Using methods to call results to display. The code i.pdf
C# Programming. Using methods to call results to display. The code i.pdffatoryoutlets
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfAroraRajinder1
 
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxsrcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxwhitneyleman54422
 
The Effective Developer - Work Smarter, not Harder
The Effective Developer - Work Smarter, not HarderThe Effective Developer - Work Smarter, not Harder
The Effective Developer - Work Smarter, not HarderSven Peters
 

Similar to package employeeType.employee;public class Employee {   private .pdf (20)

slides
slidesslides
slides
 
maJavaProjectFinalExam.classpathmaJavaProjectFinalExam.p.docx
maJavaProjectFinalExam.classpathmaJavaProjectFinalExam.p.docxmaJavaProjectFinalExam.classpathmaJavaProjectFinalExam.p.docx
maJavaProjectFinalExam.classpathmaJavaProjectFinalExam.p.docx
 
import java.io.-WPS Office.docx
import java.io.-WPS Office.docximport java.io.-WPS Office.docx
import java.io.-WPS Office.docx
 
Create a C# applicationYou are to create a class object called “Em.pdf
Create a C# applicationYou are to create a class object called “Em.pdfCreate a C# applicationYou are to create a class object called “Em.pdf
Create a C# applicationYou are to create a class object called “Em.pdf
 
define a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdfdefine a class name Employee whose objects are records for employee..pdf
define a class name Employee whose objects are records for employee..pdf
 
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdfThe solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf
The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf
 
@author public class Person{   String sname, .pdf
  @author   public class Person{   String sname, .pdf  @author   public class Person{   String sname, .pdf
@author public class Person{   String sname, .pdf
 
Hi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdfHi, I need help with a java programming project. specifically practi.pdf
Hi, I need help with a java programming project. specifically practi.pdf
 
Designing Immutability Data Flows in Ember
Designing Immutability Data Flows in EmberDesigning Immutability Data Flows in Ember
Designing Immutability Data Flows in Ember
 
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdfoperating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
operating system ubuntu,Linux,Macpublic class SuperMarket {   .pdf
 
source-code-program-menghitung-gaji-pegawai
source-code-program-menghitung-gaji-pegawaisource-code-program-menghitung-gaji-pegawai
source-code-program-menghitung-gaji-pegawai
 
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDBTDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
TDC2016POA | Trilha .NET - CQRS e ES na prática com RavenDB
 
import java.util.Random;defines the Stock class public class S.pdf
import java.util.Random;defines the Stock class public class S.pdfimport java.util.Random;defines the Stock class public class S.pdf
import java.util.Random;defines the Stock class public class S.pdf
 
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdfCreate a Code that will add an Add, Edi, and Delete button to the GU.pdf
Create a Code that will add an Add, Edi, and Delete button to the GU.pdf
 
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
Code Smells y Refactoring o haciendo que nuestro codigo huela (y se vea) mejo...
 
Having issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdfHaving issues with passing my values through different functions aft.pdf
Having issues with passing my values through different functions aft.pdf
 
C# Programming. Using methods to call results to display. The code i.pdf
C# Programming. Using methods to call results to display. The code i.pdfC# Programming. Using methods to call results to display. The code i.pdf
C# Programming. Using methods to call results to display. The code i.pdf
 
Keep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdfKeep getting a null pointer exception for some odd reasonim creati.pdf
Keep getting a null pointer exception for some odd reasonim creati.pdf
 
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docxsrcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
srcArtifact.javasrcArtifact.javaclassArtifactextendsCave{pub.docx
 
The Effective Developer - Work Smarter, not Harder
The Effective Developer - Work Smarter, not HarderThe Effective Developer - Work Smarter, not Harder
The Effective Developer - Work Smarter, not Harder
 

More from anwarsadath111

(1) c. Two-tailed test(2)d. Ho Men and women are the same in .pdf
(1) c. Two-tailed test(2)d. Ho Men and women are the same in .pdf(1) c. Two-tailed test(2)d. Ho Men and women are the same in .pdf
(1) c. Two-tailed test(2)d. Ho Men and women are the same in .pdfanwarsadath111
 
We use a base (in this case sodium bicarbonate) during the separatio.pdf
  We use a base (in this case sodium bicarbonate) during the separatio.pdf  We use a base (in this case sodium bicarbonate) during the separatio.pdf
We use a base (in this case sodium bicarbonate) during the separatio.pdfanwarsadath111
 
While computing the dilluted earnings per share Dividend paid on Pre.pdf
While computing the dilluted earnings per share Dividend paid on Pre.pdfWhile computing the dilluted earnings per share Dividend paid on Pre.pdf
While computing the dilluted earnings per share Dividend paid on Pre.pdfanwarsadath111
 
There are several ways in which the gene regulation in eukaryotes di.pdf
There are several ways in which the gene regulation in eukaryotes di.pdfThere are several ways in which the gene regulation in eukaryotes di.pdf
There are several ways in which the gene regulation in eukaryotes di.pdfanwarsadath111
 
The water must be boiled to remove traces of dissolved carbon dioxid.pdf
The water must be boiled to remove traces of dissolved carbon dioxid.pdfThe water must be boiled to remove traces of dissolved carbon dioxid.pdf
The water must be boiled to remove traces of dissolved carbon dioxid.pdfanwarsadath111
 
adsorb onto silica gel Solu.pdf
  adsorb onto silica gel                                      Solu.pdf  adsorb onto silica gel                                      Solu.pdf
adsorb onto silica gel Solu.pdfanwarsadath111
 
Solution Plants show different types of symptoms when there is an.pdf
Solution Plants show different types of symptoms when there is an.pdfSolution Plants show different types of symptoms when there is an.pdf
Solution Plants show different types of symptoms when there is an.pdfanwarsadath111
 
Quick ratio = (Cash + accounts receivable)Accounts payableFor 200.pdf
Quick ratio = (Cash + accounts receivable)Accounts payableFor 200.pdfQuick ratio = (Cash + accounts receivable)Accounts payableFor 200.pdf
Quick ratio = (Cash + accounts receivable)Accounts payableFor 200.pdfanwarsadath111
 
Ques-1) What is the most likely cause of a throat infection in a 6-y.pdf
Ques-1) What is the most likely cause of a throat infection in a 6-y.pdfQues-1) What is the most likely cause of a throat infection in a 6-y.pdf
Ques-1) What is the most likely cause of a throat infection in a 6-y.pdfanwarsadath111
 
Part1. Option 3rd; Somatic cells such as liver cells cannot undergo .pdf
Part1. Option 3rd; Somatic cells such as liver cells cannot undergo .pdfPart1. Option 3rd; Somatic cells such as liver cells cannot undergo .pdf
Part1. Option 3rd; Somatic cells such as liver cells cannot undergo .pdfanwarsadath111
 
Performance RatiosMarket Value Added (MVA)MVA=(Company’s market.pdf
Performance RatiosMarket Value Added (MVA)MVA=(Company’s market.pdfPerformance RatiosMarket Value Added (MVA)MVA=(Company’s market.pdf
Performance RatiosMarket Value Added (MVA)MVA=(Company’s market.pdfanwarsadath111
 
P = 212option ASolutionP = 212option A.pdf
P = 212option ASolutionP = 212option A.pdfP = 212option ASolutionP = 212option A.pdf
P = 212option ASolutionP = 212option A.pdfanwarsadath111
 
OSI MODELIt has 7 layersINTERNET MODELIt has5 LayersDOD MO.pdf
OSI MODELIt has 7 layersINTERNET MODELIt has5 LayersDOD MO.pdfOSI MODELIt has 7 layersINTERNET MODELIt has5 LayersDOD MO.pdf
OSI MODELIt has 7 layersINTERNET MODELIt has5 LayersDOD MO.pdfanwarsadath111
 
Option 2 namely TPP contains a thiazolium ring is correct. This is b.pdf
Option 2 namely TPP contains a thiazolium ring is correct. This is b.pdfOption 2 namely TPP contains a thiazolium ring is correct. This is b.pdf
Option 2 namely TPP contains a thiazolium ring is correct. This is b.pdfanwarsadath111
 
NH4NO3 = N2O + 2 H2OMoles of NH4NO3 = 12 x moles of H2O= 12 x .pdf
NH4NO3 = N2O + 2 H2OMoles of NH4NO3 = 12 x moles of H2O= 12 x .pdfNH4NO3 = N2O + 2 H2OMoles of NH4NO3 = 12 x moles of H2O= 12 x .pdf
NH4NO3 = N2O + 2 H2OMoles of NH4NO3 = 12 x moles of H2O= 12 x .pdfanwarsadath111
 
No. of shares outstanding = Total assets x weight of equity price .pdf
No. of shares outstanding = Total assets x weight of equity  price .pdfNo. of shares outstanding = Total assets x weight of equity  price .pdf
No. of shares outstanding = Total assets x weight of equity price .pdfanwarsadath111
 
molarity = moles volume = 2.0 x 10-3 mol (18.51000) L = 0.11 M.pdf
molarity = moles  volume = 2.0 x 10-3 mol  (18.51000) L = 0.11 M.pdfmolarity = moles  volume = 2.0 x 10-3 mol  (18.51000) L = 0.11 M.pdf
molarity = moles volume = 2.0 x 10-3 mol (18.51000) L = 0.11 M.pdfanwarsadath111
 
import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfanwarsadath111
 
hi Q is nearly done,just give me dia of shaftSolutionhi Q is n.pdf
hi Q is nearly done,just give me dia of shaftSolutionhi Q is n.pdfhi Q is nearly done,just give me dia of shaftSolutionhi Q is n.pdf
hi Q is nearly done,just give me dia of shaftSolutionhi Q is n.pdfanwarsadath111
 

More from anwarsadath111 (20)

(1) c. Two-tailed test(2)d. Ho Men and women are the same in .pdf
(1) c. Two-tailed test(2)d. Ho Men and women are the same in .pdf(1) c. Two-tailed test(2)d. Ho Men and women are the same in .pdf
(1) c. Two-tailed test(2)d. Ho Men and women are the same in .pdf
 
We use a base (in this case sodium bicarbonate) during the separatio.pdf
  We use a base (in this case sodium bicarbonate) during the separatio.pdf  We use a base (in this case sodium bicarbonate) during the separatio.pdf
We use a base (in this case sodium bicarbonate) during the separatio.pdf
 
While computing the dilluted earnings per share Dividend paid on Pre.pdf
While computing the dilluted earnings per share Dividend paid on Pre.pdfWhile computing the dilluted earnings per share Dividend paid on Pre.pdf
While computing the dilluted earnings per share Dividend paid on Pre.pdf
 
There are several ways in which the gene regulation in eukaryotes di.pdf
There are several ways in which the gene regulation in eukaryotes di.pdfThere are several ways in which the gene regulation in eukaryotes di.pdf
There are several ways in which the gene regulation in eukaryotes di.pdf
 
The water must be boiled to remove traces of dissolved carbon dioxid.pdf
The water must be boiled to remove traces of dissolved carbon dioxid.pdfThe water must be boiled to remove traces of dissolved carbon dioxid.pdf
The water must be boiled to remove traces of dissolved carbon dioxid.pdf
 
adsorb onto silica gel Solu.pdf
  adsorb onto silica gel                                      Solu.pdf  adsorb onto silica gel                                      Solu.pdf
adsorb onto silica gel Solu.pdf
 
Solution Plants show different types of symptoms when there is an.pdf
Solution Plants show different types of symptoms when there is an.pdfSolution Plants show different types of symptoms when there is an.pdf
Solution Plants show different types of symptoms when there is an.pdf
 
SF4SolutionSF4.pdf
SF4SolutionSF4.pdfSF4SolutionSF4.pdf
SF4SolutionSF4.pdf
 
Quick ratio = (Cash + accounts receivable)Accounts payableFor 200.pdf
Quick ratio = (Cash + accounts receivable)Accounts payableFor 200.pdfQuick ratio = (Cash + accounts receivable)Accounts payableFor 200.pdf
Quick ratio = (Cash + accounts receivable)Accounts payableFor 200.pdf
 
Ques-1) What is the most likely cause of a throat infection in a 6-y.pdf
Ques-1) What is the most likely cause of a throat infection in a 6-y.pdfQues-1) What is the most likely cause of a throat infection in a 6-y.pdf
Ques-1) What is the most likely cause of a throat infection in a 6-y.pdf
 
Part1. Option 3rd; Somatic cells such as liver cells cannot undergo .pdf
Part1. Option 3rd; Somatic cells such as liver cells cannot undergo .pdfPart1. Option 3rd; Somatic cells such as liver cells cannot undergo .pdf
Part1. Option 3rd; Somatic cells such as liver cells cannot undergo .pdf
 
Performance RatiosMarket Value Added (MVA)MVA=(Company’s market.pdf
Performance RatiosMarket Value Added (MVA)MVA=(Company’s market.pdfPerformance RatiosMarket Value Added (MVA)MVA=(Company’s market.pdf
Performance RatiosMarket Value Added (MVA)MVA=(Company’s market.pdf
 
P = 212option ASolutionP = 212option A.pdf
P = 212option ASolutionP = 212option A.pdfP = 212option ASolutionP = 212option A.pdf
P = 212option ASolutionP = 212option A.pdf
 
OSI MODELIt has 7 layersINTERNET MODELIt has5 LayersDOD MO.pdf
OSI MODELIt has 7 layersINTERNET MODELIt has5 LayersDOD MO.pdfOSI MODELIt has 7 layersINTERNET MODELIt has5 LayersDOD MO.pdf
OSI MODELIt has 7 layersINTERNET MODELIt has5 LayersDOD MO.pdf
 
Option 2 namely TPP contains a thiazolium ring is correct. This is b.pdf
Option 2 namely TPP contains a thiazolium ring is correct. This is b.pdfOption 2 namely TPP contains a thiazolium ring is correct. This is b.pdf
Option 2 namely TPP contains a thiazolium ring is correct. This is b.pdf
 
NH4NO3 = N2O + 2 H2OMoles of NH4NO3 = 12 x moles of H2O= 12 x .pdf
NH4NO3 = N2O + 2 H2OMoles of NH4NO3 = 12 x moles of H2O= 12 x .pdfNH4NO3 = N2O + 2 H2OMoles of NH4NO3 = 12 x moles of H2O= 12 x .pdf
NH4NO3 = N2O + 2 H2OMoles of NH4NO3 = 12 x moles of H2O= 12 x .pdf
 
No. of shares outstanding = Total assets x weight of equity price .pdf
No. of shares outstanding = Total assets x weight of equity  price .pdfNo. of shares outstanding = Total assets x weight of equity  price .pdf
No. of shares outstanding = Total assets x weight of equity price .pdf
 
molarity = moles volume = 2.0 x 10-3 mol (18.51000) L = 0.11 M.pdf
molarity = moles  volume = 2.0 x 10-3 mol  (18.51000) L = 0.11 M.pdfmolarity = moles  volume = 2.0 x 10-3 mol  (18.51000) L = 0.11 M.pdf
molarity = moles volume = 2.0 x 10-3 mol (18.51000) L = 0.11 M.pdf
 
import java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdfimport java.util.Scanner;public class Main {    public static in.pdf
import java.util.Scanner;public class Main {    public static in.pdf
 
hi Q is nearly done,just give me dia of shaftSolutionhi Q is n.pdf
hi Q is nearly done,just give me dia of shaftSolutionhi Q is n.pdfhi Q is nearly done,just give me dia of shaftSolutionhi Q is n.pdf
hi Q is nearly done,just give me dia of shaftSolutionhi Q is n.pdf
 

Recently uploaded

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxJiesonDelaCerna
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentInMediaRes1
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceSamikshaHamane
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxthorishapillay1
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxEyham Joco
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 

Recently uploaded (20)

MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
CELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptxCELL CYCLE Division Science 8 quarter IV.pptx
CELL CYCLE Division Science 8 quarter IV.pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
Meghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media ComponentMeghan Sutherland In Media Res Media Component
Meghan Sutherland In Media Res Media Component
 
Roles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in PharmacovigilanceRoles & Responsibilities in Pharmacovigilance
Roles & Responsibilities in Pharmacovigilance
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Proudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptxProudly South Africa powerpoint Thorisha.pptx
Proudly South Africa powerpoint Thorisha.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
Types of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptxTypes of Journalistic Writing Grade 8.pptx
Types of Journalistic Writing Grade 8.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 

package employeeType.employee;public class Employee {   private .pdf

  • 1. package employeeType.employee; public class Employee { private String firstName; private String lastName; private char middleInitial; private boolean fulltime; private char gender; private int employeeNum; public Employee(String firstName, String lastName, char middleInitial, char gender, int employeeNum, boolean fulltime) { super(); this.firstName = firstName; this.lastName = lastName; this.middleInitial = middleInitial; this.fulltime = fulltime; this.gender = gender; this.employeeNum = employeeNum; } public int getEmployeeNumber() { return this.employeeNum; } public void setEmployeeNumber(int empNum) { this.employeeNum = empNum; } public String getFirstName() { return firstName; } String getLastName() { return lastName; } char getMiddleInitial() { return middleInitial; } public char getGender() { return gender;
  • 2. } public void setFirstName(String fn) { this.firstName = fn; } public void setLastName(String ln) { this.lastName = ln; } public void setMiddleI(char m) { this.middleInitial = m; } public void setGender(char g) { this.gender = g; } public boolean equals(Object obj) { // TODO Auto-generated method stub if (obj instanceof Employee) { Employee employee = (Employee) obj; if (employee.getEmployeeNumber() == this.getEmployeeNumber()) return true; else return false; } else return false; } public String toString() { // TODO Auto-generated method stub return getEmployeeNumber() + " " + getFirstName() + " " + getLastName() + " Gender:" + getGender() + " Status:" + ((fulltime) ? "Full Time" : "Part Time"); } } package employeeType.subTypes; import java.text.DecimalFormat; import employeeType.employee.Employee; public class HourlyEmployee extends Employee { private double wage;
  • 3. private double hoursWorked; public HourlyEmployee(String firstName, String lastName, char middleInitial, char gender, int employeeNum, boolean fulltime, double wage) { super(firstName, lastName, middleInitial, gender, employeeNum, fulltime); // TODO Auto-generated constructor stub this.wage = wage; this.hoursWorked = 0.0d; } public void increaseHours(double hours) { if (hours > 0) this.hoursWorked += hours; else System.out.println("Error! Invalid hours"); } public String toString() { // TODO Auto-generated method stub return super.toString() + " Wage: " + wage + " Hours Worked: " + hoursWorked; } public double calculateWeeklyPay() { double pay; if (hoursWorked > 40) { pay = (40 * wage) + (2 * (hoursWorked - 40) * wage); } else { pay = wage * hoursWorked; } return pay; } public void annualRaise() { DecimalFormat decimalFormat = new DecimalFormat("#.##"); wage = Double.valueOf(decimalFormat.format(wage * 0.05)); } public double holidayBonus() { return 40 * wage; }
  • 4. public void resetWeek() { this.hoursWorked = 0; } } package employeeType.subTypes; import java.text.DecimalFormat; import employeeType.employee.Employee; public class SalaryEmployee extends Employee { double salary; public SalaryEmployee(String firstName, String lastName, char middleInitial, char gender, int employeeNum, boolean fulltime, double s) { super(firstName, lastName, middleInitial, gender, employeeNum, fulltime); // TODO Auto-generated constructor stub this.salary = s; } public String toString() { // TODO Auto-generated method stub return super.toString() + " Salary:" + salary; } public double calculateWeeklyPay() { return salary / 52.00d; } public void annualRaise() { DecimalFormat decimalFormat = new DecimalFormat("#.##"); salary = Double.valueOf(decimalFormat.format(salary * 0.06)); } public double holidayBonus() { return salary * 0.03; } public void resetWeek() { } } package employeeType.subTypes; import employeeType.employee.Employee; public class CommissionEmployee extends Employee {
  • 5. double sales; double rate; public CommissionEmployee(String firstName, String lastName, char middleInitial, char gender, int employeeNum, boolean fulltime, double r) { super(firstName, lastName, middleInitial, gender, employeeNum, fulltime); // TODO Auto-generated constructor stub this.rate = r; this.sales = 0.0d; } public String toString() { // TODO Auto-generated method stub return super.toString() + " Rate: " + rate + " Sales: " + sales; } public void increaseSales(double sales) { if (sales > 0) this.sales += sales; else System.out.println("Error! Not valid sales"); } public double calculateWeeklyPay() { return sales * rate / 100; } public void annualRaise() { this.rate += 0.02; } public double holidayBonus() { return 0.00d; } public void resetWeek() { this.sales = 0.0d; } } import employeeType.subTypes.CommissionEmployee; import employeeType.subTypes.HourlyEmployee; import employeeType.subTypes.SalaryEmployee;
  • 6. public class EmployeeTest { public static void main(String args[]) { // Create references for our objects HourlyEmployee hourly; SalaryEmployee salary; CommissionEmployee commission; // The sum of all bonuses will be placed here double bonusPayout = 0; // Create and print a new HourlyEmployee hourly = HourlyFactory(); System.out.printf(" %s ", hourly); // Create and print a new SalaryEmployee salary = SalaryFactory(); System.out.printf(" %s ", salary); // Create and print a new CommissionEmployee commission = CommissionFactory(); System.out.printf(" %s ", commission); // Alter some values of Hourly and Commission System.out.println("Increasing Hourly's hours worked by 50."); hourly.increaseHours(50); System.out.println("Increasing Commissions's sales by 150,000. "); commission.increaseSales(150000); // Output weekly pay for each Employee System.out.printf("Hourly Payout: %.2f ", hourly.calculateWeeklyPay()); System.out.printf("Salary Payout: %.2f ", salary.calculateWeeklyPay()); System.out.printf("Commission Payout: %.2f ", commission.calculateWeeklyPay()); // Find total bonus payout System.out.println("Finding total bonus payout..."); bonusPayout += hourly.holidayBonus(); bonusPayout += salary.holidayBonus(); bonusPayout += commission.holidayBonus(); System.out.printf("Bonus Payout is %.2f ", bonusPayout); // Reset the week and apply raises to all Employees System.out.println("Applying annual raises and resetting week..."); hourly.resetWeek();
  • 7. hourly.annualRaise(); salary.resetWeek(); salary.annualRaise(); commission.resetWeek(); commission.annualRaise(); // Output Employees after changes System.out.printf("%s %s %s ", hourly, salary, commission); } // Retrieve input and create HourlyEmployee public static HourlyEmployee HourlyFactory() { System.out.println("Creating HourlyEmployee..."); return new HourlyEmployee("Steve", "Rogers", 'A', 'M', 12345, true, 15.34); } // Retrieve input and create SalaryEmployee public static SalaryEmployee SalaryFactory() { System.out.println("Creating SalaryEmployee..."); return new SalaryEmployee("Kitty", "Pryde", 'X', 'F', 54321, true, 75000); } // Retrieve input and create CommissionEmployee public static CommissionEmployee CommissionFactory() { System.out.println("Creating CommissionEmployee..."); return new CommissionEmployee("Johnny", "Storm", 'F', 'L', 976499, false, 2.5); } } OUTPUT: Creating HourlyEmployee... 12345 Steve Rogers Gender:M Status:Full Time Wage: 15.34 Hours Worked: 0.0 Creating SalaryEmployee...
  • 8. 54321 Kitty Pryde Gender:F Status:Full Time Salary:75000.0 Creating CommissionEmployee... 976499 Johnny Storm Gender:L Status:Part Time Rate: 2.5 Sales: 0.0 Increasing Hourly's hours worked by 50. Increasing Commissions's sales by 150,000. Hourly Payout: 920.40 Salary Payout: 1442.31 Commission Payout: 3750.00 Finding total bonus payout... Bonus Payout is 2863.60 Applying annual raises and resetting week... 12345 Steve Rogers Gender:M Status:Full Time Wage: 0.77 Hours Worked: 0.0 54321 Kitty Pryde Gender:F Status:Full Time Salary:4500.0 976499 Johnny Storm Gender:L Status:Part Time Rate: 2.52
  • 9. Sales: 0.0 Solution package employeeType.employee; public class Employee { private String firstName; private String lastName; private char middleInitial; private boolean fulltime; private char gender; private int employeeNum; public Employee(String firstName, String lastName, char middleInitial, char gender, int employeeNum, boolean fulltime) { super(); this.firstName = firstName; this.lastName = lastName; this.middleInitial = middleInitial; this.fulltime = fulltime; this.gender = gender; this.employeeNum = employeeNum; } public int getEmployeeNumber() { return this.employeeNum; } public void setEmployeeNumber(int empNum) { this.employeeNum = empNum; } public String getFirstName() { return firstName; } String getLastName() { return lastName; } char getMiddleInitial() { return middleInitial;
  • 10. } public char getGender() { return gender; } public void setFirstName(String fn) { this.firstName = fn; } public void setLastName(String ln) { this.lastName = ln; } public void setMiddleI(char m) { this.middleInitial = m; } public void setGender(char g) { this.gender = g; } public boolean equals(Object obj) { // TODO Auto-generated method stub if (obj instanceof Employee) { Employee employee = (Employee) obj; if (employee.getEmployeeNumber() == this.getEmployeeNumber()) return true; else return false; } else return false; } public String toString() { // TODO Auto-generated method stub return getEmployeeNumber() + " " + getFirstName() + " " + getLastName() + " Gender:" + getGender() + " Status:" + ((fulltime) ? "Full Time" : "Part Time"); } } package employeeType.subTypes; import java.text.DecimalFormat;
  • 11. import employeeType.employee.Employee; public class HourlyEmployee extends Employee { private double wage; private double hoursWorked; public HourlyEmployee(String firstName, String lastName, char middleInitial, char gender, int employeeNum, boolean fulltime, double wage) { super(firstName, lastName, middleInitial, gender, employeeNum, fulltime); // TODO Auto-generated constructor stub this.wage = wage; this.hoursWorked = 0.0d; } public void increaseHours(double hours) { if (hours > 0) this.hoursWorked += hours; else System.out.println("Error! Invalid hours"); } public String toString() { // TODO Auto-generated method stub return super.toString() + " Wage: " + wage + " Hours Worked: " + hoursWorked; } public double calculateWeeklyPay() { double pay; if (hoursWorked > 40) { pay = (40 * wage) + (2 * (hoursWorked - 40) * wage); } else { pay = wage * hoursWorked; } return pay; } public void annualRaise() { DecimalFormat decimalFormat = new DecimalFormat("#.##"); wage = Double.valueOf(decimalFormat.format(wage * 0.05)); }
  • 12. public double holidayBonus() { return 40 * wage; } public void resetWeek() { this.hoursWorked = 0; } } package employeeType.subTypes; import java.text.DecimalFormat; import employeeType.employee.Employee; public class SalaryEmployee extends Employee { double salary; public SalaryEmployee(String firstName, String lastName, char middleInitial, char gender, int employeeNum, boolean fulltime, double s) { super(firstName, lastName, middleInitial, gender, employeeNum, fulltime); // TODO Auto-generated constructor stub this.salary = s; } public String toString() { // TODO Auto-generated method stub return super.toString() + " Salary:" + salary; } public double calculateWeeklyPay() { return salary / 52.00d; } public void annualRaise() { DecimalFormat decimalFormat = new DecimalFormat("#.##"); salary = Double.valueOf(decimalFormat.format(salary * 0.06)); } public double holidayBonus() { return salary * 0.03; } public void resetWeek() { } }
  • 13. package employeeType.subTypes; import employeeType.employee.Employee; public class CommissionEmployee extends Employee { double sales; double rate; public CommissionEmployee(String firstName, String lastName, char middleInitial, char gender, int employeeNum, boolean fulltime, double r) { super(firstName, lastName, middleInitial, gender, employeeNum, fulltime); // TODO Auto-generated constructor stub this.rate = r; this.sales = 0.0d; } public String toString() { // TODO Auto-generated method stub return super.toString() + " Rate: " + rate + " Sales: " + sales; } public void increaseSales(double sales) { if (sales > 0) this.sales += sales; else System.out.println("Error! Not valid sales"); } public double calculateWeeklyPay() { return sales * rate / 100; } public void annualRaise() { this.rate += 0.02; } public double holidayBonus() { return 0.00d; } public void resetWeek() { this.sales = 0.0d; } }
  • 14. import employeeType.subTypes.CommissionEmployee; import employeeType.subTypes.HourlyEmployee; import employeeType.subTypes.SalaryEmployee; public class EmployeeTest { public static void main(String args[]) { // Create references for our objects HourlyEmployee hourly; SalaryEmployee salary; CommissionEmployee commission; // The sum of all bonuses will be placed here double bonusPayout = 0; // Create and print a new HourlyEmployee hourly = HourlyFactory(); System.out.printf(" %s ", hourly); // Create and print a new SalaryEmployee salary = SalaryFactory(); System.out.printf(" %s ", salary); // Create and print a new CommissionEmployee commission = CommissionFactory(); System.out.printf(" %s ", commission); // Alter some values of Hourly and Commission System.out.println("Increasing Hourly's hours worked by 50."); hourly.increaseHours(50); System.out.println("Increasing Commissions's sales by 150,000. "); commission.increaseSales(150000); // Output weekly pay for each Employee System.out.printf("Hourly Payout: %.2f ", hourly.calculateWeeklyPay()); System.out.printf("Salary Payout: %.2f ", salary.calculateWeeklyPay()); System.out.printf("Commission Payout: %.2f ", commission.calculateWeeklyPay()); // Find total bonus payout System.out.println("Finding total bonus payout..."); bonusPayout += hourly.holidayBonus(); bonusPayout += salary.holidayBonus(); bonusPayout += commission.holidayBonus(); System.out.printf("Bonus Payout is %.2f ", bonusPayout);
  • 15. // Reset the week and apply raises to all Employees System.out.println("Applying annual raises and resetting week..."); hourly.resetWeek(); hourly.annualRaise(); salary.resetWeek(); salary.annualRaise(); commission.resetWeek(); commission.annualRaise(); // Output Employees after changes System.out.printf("%s %s %s ", hourly, salary, commission); } // Retrieve input and create HourlyEmployee public static HourlyEmployee HourlyFactory() { System.out.println("Creating HourlyEmployee..."); return new HourlyEmployee("Steve", "Rogers", 'A', 'M', 12345, true, 15.34); } // Retrieve input and create SalaryEmployee public static SalaryEmployee SalaryFactory() { System.out.println("Creating SalaryEmployee..."); return new SalaryEmployee("Kitty", "Pryde", 'X', 'F', 54321, true, 75000); } // Retrieve input and create CommissionEmployee public static CommissionEmployee CommissionFactory() { System.out.println("Creating CommissionEmployee..."); return new CommissionEmployee("Johnny", "Storm", 'F', 'L', 976499, false, 2.5); } } OUTPUT: Creating HourlyEmployee... 12345 Steve Rogers Gender:M Status:Full Time
  • 16. Wage: 15.34 Hours Worked: 0.0 Creating SalaryEmployee... 54321 Kitty Pryde Gender:F Status:Full Time Salary:75000.0 Creating CommissionEmployee... 976499 Johnny Storm Gender:L Status:Part Time Rate: 2.5 Sales: 0.0 Increasing Hourly's hours worked by 50. Increasing Commissions's sales by 150,000. Hourly Payout: 920.40 Salary Payout: 1442.31 Commission Payout: 3750.00 Finding total bonus payout... Bonus Payout is 2863.60 Applying annual raises and resetting week... 12345 Steve Rogers Gender:M Status:Full Time Wage: 0.77 Hours Worked: 0.0 54321 Kitty Pryde Gender:F Status:Full Time Salary:4500.0 976499 Johnny Storm