SlideShare a Scribd company logo
1 of 17
Download to read offline
The solution is as below:
EmployeeDemo.java
import java.util.Scanner;
public class EmployeeDemo
{
static Scanner scan = new Scanner(System.in);
public static void main(String[] args)
{
Company clerk = new Company( );
Employee employee = new Employee();// one student
int count,dependent;
String fname,lname;
float hourly_rate,no_of_hours,l_tax,f_tax,s_tax;
System.out.println("Enter number of employees:");
int numberOfEmployees = scan.nextInt();
for (count = 0; count < numberOfEmployees; count++)
{
System.out.println("Enter data for employee number " + count);
System.out.println("First Name ");
fname = scan.next();
System.out.println("Last Name ");
lname = scan.next();
System.out.println("Number of dependents ");
dependent = scan.nextInt();
System.out.println("Hourly rate ");
hourly_rate = scan.nextFloat();
System.out.println("Number of hours worked ");
no_of_hours = scan.nextFloat();
System.out.println("Local tax withheld to date ");
l_tax = scan.nextFloat();
System.out.println("Federal tax withheld to date ");
f_tax = scan.nextFloat();
System.out.println("State tax withheld to date ");
s_tax = scan.nextFloat();
employee.readInput(fname,lname,dependent,hourly_rate,no_of_hours,l_tax,f_tax,s_tax);
employee.calculateData(count);
employee.writeOutput(count);
clerk.colectDataForCompanyReport(employee,count);
}
clerk.printDataForCompanyReport();
}
}
Employee.java
import java.util.ArrayList;
public class Employee {
private ArrayList fname,lname;
private ArrayList dependent;
private ArrayList
hourly_rate,no_of_hours,l_tax,f_tax,s_tax,g_wages,cf_tax,cl_tax,cs_tax,t_tax,ct_tax,net_pay;
public Employee(){
fname = new ArrayList();
lname = new ArrayList();
dependent = new ArrayList();
hourly_rate = new ArrayList();
no_of_hours = new ArrayList();
l_tax = new ArrayList();
f_tax = new ArrayList();
s_tax = new ArrayList();
g_wages = new ArrayList();
cl_tax = new ArrayList();
cf_tax = new ArrayList();
cs_tax = new ArrayList();
t_tax = new ArrayList();
ct_tax = new ArrayList();
net_pay = new ArrayList();
}
public ArrayList getFname() {
return fname;
}
public void setFname(ArrayList fname) {
this.fname = fname;
}
public ArrayList getLname() {
return lname;
}
public void setLname(ArrayList lname) {
this.lname = lname;
}
public ArrayList getDependent() {
return dependent;
}
public void setDependent(ArrayList dependent) {
this.dependent = dependent;
}
public ArrayList getHourly_rate() {
return hourly_rate;
}
public void setHourly_rate(ArrayList hourly_rate) {
this.hourly_rate = hourly_rate;
}
public ArrayList getNo_of_hours() {
return no_of_hours;
}
public void setNo_of_hours(ArrayList no_of_hours) {
this.no_of_hours = no_of_hours;
}
public ArrayList getL_tax() {
return l_tax;
}
public void setL_tax(ArrayList l_tax) {
this.l_tax = l_tax;
}
public ArrayList getF_tax() {
return f_tax;
}
public void setF_tax(ArrayList f_tax) {
this.f_tax = f_tax;
}
public ArrayList getS_tax() {
return s_tax;
}
public void setS_tax(ArrayList s_tax) {
this.s_tax = s_tax;
}
public ArrayList getG_wages() {
return g_wages;
}
public void setG_wages(ArrayList g_wages) {
this.g_wages = g_wages;
}
public ArrayList getCf_tax() {
return cf_tax;
}
public void setCf_tax(ArrayList cf_tax) {
this.cf_tax = cf_tax;
}
public ArrayList getCl_tax() {
return cl_tax;
}
public void setCl_tax(ArrayList cl_tax) {
this.cl_tax = cl_tax;
}
public ArrayList getCs_tax() {
return cs_tax;
}
public void setCs_tax(ArrayList cs_tax) {
this.cs_tax = cs_tax;
}
public ArrayList getT_tax() {
return t_tax;
}
public void setT_tax(ArrayList t_tax) {
this.t_tax = t_tax;
}
public ArrayList getCt_tax() {
return ct_tax;
}
public void setCt_tax(ArrayList ct_tax) {
this.ct_tax = ct_tax;
}
public ArrayList getNet_pay() {
return net_pay;
}
public void setNet_pay(ArrayList net_pay) {
this.net_pay = net_pay;
}
public void readInput(String fname2, String lname2, int dependent2, float hourly_rate2, float
no_of_hours2, float l_tax2, float f_tax2, float s_tax2){
this.fname.add(fname2);
this.lname.add(lname2);
this.dependent.add(dependent2);
this.hourly_rate.add(hourly_rate2);
this.no_of_hours.add(no_of_hours2);
this.l_tax.add(l_tax2);
this.f_tax.add(f_tax2);
this.s_tax.add(s_tax2);
}
public void writeOutput(int i){
System.out.println("Employee: " + fname.get(i) + " " + lname.get(i));
System.out.println("Hours Worked: " + no_of_hours.get(i));
System.out.println("Hourly Rate: " + hourly_rate.get(i));
System.out.println("Gross Wages: " + g_wages.get(i));
System.out.println("Current Yr. To Date");
System.out.println("Federal " + cf_tax.get(i) + " " + f_tax.get(i));
System.out.println("State " + cs_tax.get(i) + " " + s_tax.get(i));
System.out.println("Local " + cl_tax.get(i) + " " + l_tax.get(i));
System.out.println("Total Deductions " + ct_tax.get(i));
System.out.println("Net Pay " + net_pay.get(i));
}
public void calculateData(int i) {
// TODO Auto-generated method stub
float
f_tax,g_pay,temp,annual_pay,tax_percent,l_tax,temp2,s_tax,f_tax1,s_tax1,l_tax1,t_tax;
g_pay = this.hourly_rate.get(i) * this.no_of_hours.get(i);
temp = g_pay - (15 * this.dependent.get(i));
annual_pay = temp * 52;
if(annual_pay > 40000)
tax_percent = 0.3f;
else if(annual_pay > 20000 && annual_pay < 40000)
tax_percent = 0.2f;
else
tax_percent = 0.1f;
f_tax = temp * tax_percent;
l_tax = (float) (g_pay * 0.0115);
temp2 = this.l_tax.get(i) + l_tax;
if(temp2 > 517.50){
l_tax = (float) (517.50 - this.l_tax.get(i));
}
if(annual_pay > 30000)
tax_percent = 0.1f;
else
tax_percent = 0.05f;
s_tax = temp * tax_percent;
f_tax1 = this.f_tax.get(i);
s_tax1 = this.s_tax.get(i);
l_tax1 = this.l_tax.get(i);
this.g_wages.add(g_pay);
this.cf_tax.add(f_tax);
this.cl_tax.add(l_tax);
this.s_tax.add(s_tax);
this.f_tax.set(i, (f_tax + f_tax1));
this.s_tax.set(i, (s_tax + s_tax1));
this.l_tax.set(i, (l_tax + l_tax1));
this.ct_tax.add(f_tax + l_tax + s_tax);
this.net_pay.add(g_pay - (f_tax + l_tax + s_tax));
t_tax = this.s_tax.get(i) + this.f_tax.get(i) + this.l_tax.get(i);
this.t_tax.add(t_tax);
}
}
Company.java
public class Company {
private float f_tax,s_tax,t_deduction,g_wages,net_pay,cf_tax,cs_tax,ct_deduction;
public float getF_tax() {
return f_tax;
}
public void setF_tax(float f_tax) {
this.f_tax = f_tax;
}
public float getS_tax() {
return s_tax;
}
public void setS_tax(float s_tax) {
this.s_tax = s_tax;
}
public float getT_deduction() {
return t_deduction;
}
public void setT_deduction(float t_deduction) {
this.t_deduction = t_deduction;
}
public float getG_wages() {
return g_wages;
}
public void setG_wages(float g_wages) {
this.g_wages = g_wages;
}
public float getNet_pay() {
return net_pay;
}
public void setNet_pay(float net_pay) {
this.net_pay = net_pay;
}
public float getCf_tax() {
return cf_tax;
}
public void setCf_tax(float cf_tax) {
this.cf_tax = cf_tax;
}
public float getCs_tax() {
return cs_tax;
}
public void setCs_tax(float cs_tax) {
this.cs_tax = cs_tax;
}
public float getCt_deduction() {
return ct_deduction;
}
public void setCt_deduction(float ct_deduction) {
this.ct_deduction = ct_deduction;
}
public void colectDataForCompanyReport(Employee employee, int i) {
// TODO Auto-generated method stub
for(int j=0 ; j
Solution
The solution is as below:
EmployeeDemo.java
import java.util.Scanner;
public class EmployeeDemo
{
static Scanner scan = new Scanner(System.in);
public static void main(String[] args)
{
Company clerk = new Company( );
Employee employee = new Employee();// one student
int count,dependent;
String fname,lname;
float hourly_rate,no_of_hours,l_tax,f_tax,s_tax;
System.out.println("Enter number of employees:");
int numberOfEmployees = scan.nextInt();
for (count = 0; count < numberOfEmployees; count++)
{
System.out.println("Enter data for employee number " + count);
System.out.println("First Name ");
fname = scan.next();
System.out.println("Last Name ");
lname = scan.next();
System.out.println("Number of dependents ");
dependent = scan.nextInt();
System.out.println("Hourly rate ");
hourly_rate = scan.nextFloat();
System.out.println("Number of hours worked ");
no_of_hours = scan.nextFloat();
System.out.println("Local tax withheld to date ");
l_tax = scan.nextFloat();
System.out.println("Federal tax withheld to date ");
f_tax = scan.nextFloat();
System.out.println("State tax withheld to date ");
s_tax = scan.nextFloat();
employee.readInput(fname,lname,dependent,hourly_rate,no_of_hours,l_tax,f_tax,s_tax);
employee.calculateData(count);
employee.writeOutput(count);
clerk.colectDataForCompanyReport(employee,count);
}
clerk.printDataForCompanyReport();
}
}
Employee.java
import java.util.ArrayList;
public class Employee {
private ArrayList fname,lname;
private ArrayList dependent;
private ArrayList
hourly_rate,no_of_hours,l_tax,f_tax,s_tax,g_wages,cf_tax,cl_tax,cs_tax,t_tax,ct_tax,net_pay;
public Employee(){
fname = new ArrayList();
lname = new ArrayList();
dependent = new ArrayList();
hourly_rate = new ArrayList();
no_of_hours = new ArrayList();
l_tax = new ArrayList();
f_tax = new ArrayList();
s_tax = new ArrayList();
g_wages = new ArrayList();
cl_tax = new ArrayList();
cf_tax = new ArrayList();
cs_tax = new ArrayList();
t_tax = new ArrayList();
ct_tax = new ArrayList();
net_pay = new ArrayList();
}
public ArrayList getFname() {
return fname;
}
public void setFname(ArrayList fname) {
this.fname = fname;
}
public ArrayList getLname() {
return lname;
}
public void setLname(ArrayList lname) {
this.lname = lname;
}
public ArrayList getDependent() {
return dependent;
}
public void setDependent(ArrayList dependent) {
this.dependent = dependent;
}
public ArrayList getHourly_rate() {
return hourly_rate;
}
public void setHourly_rate(ArrayList hourly_rate) {
this.hourly_rate = hourly_rate;
}
public ArrayList getNo_of_hours() {
return no_of_hours;
}
public void setNo_of_hours(ArrayList no_of_hours) {
this.no_of_hours = no_of_hours;
}
public ArrayList getL_tax() {
return l_tax;
}
public void setL_tax(ArrayList l_tax) {
this.l_tax = l_tax;
}
public ArrayList getF_tax() {
return f_tax;
}
public void setF_tax(ArrayList f_tax) {
this.f_tax = f_tax;
}
public ArrayList getS_tax() {
return s_tax;
}
public void setS_tax(ArrayList s_tax) {
this.s_tax = s_tax;
}
public ArrayList getG_wages() {
return g_wages;
}
public void setG_wages(ArrayList g_wages) {
this.g_wages = g_wages;
}
public ArrayList getCf_tax() {
return cf_tax;
}
public void setCf_tax(ArrayList cf_tax) {
this.cf_tax = cf_tax;
}
public ArrayList getCl_tax() {
return cl_tax;
}
public void setCl_tax(ArrayList cl_tax) {
this.cl_tax = cl_tax;
}
public ArrayList getCs_tax() {
return cs_tax;
}
public void setCs_tax(ArrayList cs_tax) {
this.cs_tax = cs_tax;
}
public ArrayList getT_tax() {
return t_tax;
}
public void setT_tax(ArrayList t_tax) {
this.t_tax = t_tax;
}
public ArrayList getCt_tax() {
return ct_tax;
}
public void setCt_tax(ArrayList ct_tax) {
this.ct_tax = ct_tax;
}
public ArrayList getNet_pay() {
return net_pay;
}
public void setNet_pay(ArrayList net_pay) {
this.net_pay = net_pay;
}
public void readInput(String fname2, String lname2, int dependent2, float hourly_rate2, float
no_of_hours2, float l_tax2, float f_tax2, float s_tax2){
this.fname.add(fname2);
this.lname.add(lname2);
this.dependent.add(dependent2);
this.hourly_rate.add(hourly_rate2);
this.no_of_hours.add(no_of_hours2);
this.l_tax.add(l_tax2);
this.f_tax.add(f_tax2);
this.s_tax.add(s_tax2);
}
public void writeOutput(int i){
System.out.println("Employee: " + fname.get(i) + " " + lname.get(i));
System.out.println("Hours Worked: " + no_of_hours.get(i));
System.out.println("Hourly Rate: " + hourly_rate.get(i));
System.out.println("Gross Wages: " + g_wages.get(i));
System.out.println("Current Yr. To Date");
System.out.println("Federal " + cf_tax.get(i) + " " + f_tax.get(i));
System.out.println("State " + cs_tax.get(i) + " " + s_tax.get(i));
System.out.println("Local " + cl_tax.get(i) + " " + l_tax.get(i));
System.out.println("Total Deductions " + ct_tax.get(i));
System.out.println("Net Pay " + net_pay.get(i));
}
public void calculateData(int i) {
// TODO Auto-generated method stub
float
f_tax,g_pay,temp,annual_pay,tax_percent,l_tax,temp2,s_tax,f_tax1,s_tax1,l_tax1,t_tax;
g_pay = this.hourly_rate.get(i) * this.no_of_hours.get(i);
temp = g_pay - (15 * this.dependent.get(i));
annual_pay = temp * 52;
if(annual_pay > 40000)
tax_percent = 0.3f;
else if(annual_pay > 20000 && annual_pay < 40000)
tax_percent = 0.2f;
else
tax_percent = 0.1f;
f_tax = temp * tax_percent;
l_tax = (float) (g_pay * 0.0115);
temp2 = this.l_tax.get(i) + l_tax;
if(temp2 > 517.50){
l_tax = (float) (517.50 - this.l_tax.get(i));
}
if(annual_pay > 30000)
tax_percent = 0.1f;
else
tax_percent = 0.05f;
s_tax = temp * tax_percent;
f_tax1 = this.f_tax.get(i);
s_tax1 = this.s_tax.get(i);
l_tax1 = this.l_tax.get(i);
this.g_wages.add(g_pay);
this.cf_tax.add(f_tax);
this.cl_tax.add(l_tax);
this.s_tax.add(s_tax);
this.f_tax.set(i, (f_tax + f_tax1));
this.s_tax.set(i, (s_tax + s_tax1));
this.l_tax.set(i, (l_tax + l_tax1));
this.ct_tax.add(f_tax + l_tax + s_tax);
this.net_pay.add(g_pay - (f_tax + l_tax + s_tax));
t_tax = this.s_tax.get(i) + this.f_tax.get(i) + this.l_tax.get(i);
this.t_tax.add(t_tax);
}
}
Company.java
public class Company {
private float f_tax,s_tax,t_deduction,g_wages,net_pay,cf_tax,cs_tax,ct_deduction;
public float getF_tax() {
return f_tax;
}
public void setF_tax(float f_tax) {
this.f_tax = f_tax;
}
public float getS_tax() {
return s_tax;
}
public void setS_tax(float s_tax) {
this.s_tax = s_tax;
}
public float getT_deduction() {
return t_deduction;
}
public void setT_deduction(float t_deduction) {
this.t_deduction = t_deduction;
}
public float getG_wages() {
return g_wages;
}
public void setG_wages(float g_wages) {
this.g_wages = g_wages;
}
public float getNet_pay() {
return net_pay;
}
public void setNet_pay(float net_pay) {
this.net_pay = net_pay;
}
public float getCf_tax() {
return cf_tax;
}
public void setCf_tax(float cf_tax) {
this.cf_tax = cf_tax;
}
public float getCs_tax() {
return cs_tax;
}
public void setCs_tax(float cs_tax) {
this.cs_tax = cs_tax;
}
public float getCt_deduction() {
return ct_deduction;
}
public void setCt_deduction(float ct_deduction) {
this.ct_deduction = ct_deduction;
}
public void colectDataForCompanyReport(Employee employee, int i) {
// TODO Auto-generated method stub
for(int j=0 ; j

More Related Content

Similar to The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf

Write the program in MIPS that declares an array of positive integer.pdf
Write the program in MIPS that declares an array of positive integer.pdfWrite the program in MIPS that declares an array of positive integer.pdf
Write the program in MIPS that declares an array of positive integer.pdfarihanthtoysandgifts
 
Java Language.....pdf
Java Language.....pdfJava Language.....pdf
Java Language.....pdfbadshetoms
 
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
 
Code Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdfCode Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdfankitmobileshop235
 
JAVA...With N.E.T_B.E.A.N.S___________________________________.pdf
JAVA...With N.E.T_B.E.A.N.S___________________________________.pdfJAVA...With N.E.T_B.E.A.N.S___________________________________.pdf
JAVA...With N.E.T_B.E.A.N.S___________________________________.pdfcalderoncasto9163
 
JAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdfJAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdfkarymadelaneyrenne19
 
You are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdfYou are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdfJUSTSTYLISH3B2MOHALI
 
Write a java program to randomly generate the following sets of data.pdf
Write a java program to randomly generate the following sets of data.pdfWrite a java program to randomly generate the following sets of data.pdf
Write a java program to randomly generate the following sets of data.pdfarshin9
 
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxPROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxamrit47
 
2. Create a Java class called EmployeeMain within the same project Pr.docx
 2. Create a Java class called EmployeeMain within the same project Pr.docx 2. Create a Java class called EmployeeMain within the same project Pr.docx
2. Create a Java class called EmployeeMain within the same project Pr.docxajoy21
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 SolutionHazrat Bilal
 
5 c control statements looping
5  c control statements looping5  c control statements looping
5 c control statements loopingMomenMostafa
 

Similar to The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf (20)

Write the program in MIPS that declares an array of positive integer.pdf
Write the program in MIPS that declares an array of positive integer.pdfWrite the program in MIPS that declares an array of positive integer.pdf
Write the program in MIPS that declares an array of positive integer.pdf
 
java assignment
java assignmentjava assignment
java assignment
 
Java Language.....pdf
Java Language.....pdfJava Language.....pdf
Java Language.....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
 
Code Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdfCode Include libraries. import javax.swing.JOptionPane;.pdf
Code Include libraries. import javax.swing.JOptionPane;.pdf
 
JAVA...With N.E.T_B.E.A.N.S___________________________________.pdf
JAVA...With N.E.T_B.E.A.N.S___________________________________.pdfJAVA...With N.E.T_B.E.A.N.S___________________________________.pdf
JAVA...With N.E.T_B.E.A.N.S___________________________________.pdf
 
Java
JavaJava
Java
 
5 Rmi Print
5  Rmi Print5  Rmi Print
5 Rmi Print
 
4.3 Hibernate example.docx
4.3 Hibernate example.docx4.3 Hibernate example.docx
4.3 Hibernate example.docx
 
JAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdfJAVA.Q4 Create a Time class. This class will represent a point in.pdf
JAVA.Q4 Create a Time class. This class will represent a point in.pdf
 
You are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdfYou are to simulate a dispatcher using a priority queue system in C+.pdf
You are to simulate a dispatcher using a priority queue system in C+.pdf
 
Write a java program to randomly generate the following sets of data.pdf
Write a java program to randomly generate the following sets of data.pdfWrite a java program to randomly generate the following sets of data.pdf
Write a java program to randomly generate the following sets of data.pdf
 
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docxPROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
PROVIDE COMMENTS TO FELLOW STUDENTS ANSWERS AND PLEASE DON’T SAY G.docx
 
2. Create a Java class called EmployeeMain within the same project Pr.docx
 2. Create a Java class called EmployeeMain within the same project Pr.docx 2. Create a Java class called EmployeeMain within the same project Pr.docx
2. Create a Java class called EmployeeMain within the same project Pr.docx
 
BCSL 058 solved assignment
BCSL 058 solved assignmentBCSL 058 solved assignment
BCSL 058 solved assignment
 
Code optimization
Code optimization Code optimization
Code optimization
 
Code optimization
Code optimization Code optimization
Code optimization
 
Let us C (by yashvant Kanetkar) chapter 3 Solution
Let us C   (by yashvant Kanetkar) chapter 3 SolutionLet us C   (by yashvant Kanetkar) chapter 3 Solution
Let us C (by yashvant Kanetkar) chapter 3 Solution
 
5 c control statements looping
5  c control statements looping5  c control statements looping
5 c control statements looping
 
Array Cont
Array ContArray Cont
Array Cont
 

More from aparnatiwari291

When two data sets are pooled together the pooled mean will alway.pdf
 When two data sets are pooled together the pooled mean will alway.pdf When two data sets are pooled together the pooled mean will alway.pdf
When two data sets are pooled together the pooled mean will alway.pdfaparnatiwari291
 
DELTOID flexes and medially rotates arm; prime mover of arm abduct.pdf
  DELTOID  flexes and medially rotates arm; prime mover of arm abduct.pdf  DELTOID  flexes and medially rotates arm; prime mover of arm abduct.pdf
DELTOID flexes and medially rotates arm; prime mover of arm abduct.pdfaparnatiwari291
 
Event Cash Flow   Assets Claims Income Statement OAIAFA Cash.pdf
    Event Cash Flow   Assets  Claims Income Statement    OAIAFA Cash.pdf    Event Cash Flow   Assets  Claims Income Statement    OAIAFA Cash.pdf
Event Cash Flow   Assets Claims Income Statement OAIAFA Cash.pdfaparnatiwari291
 
We know that Molarity = No . of moles Volume of.pdf
                     We know that Molarity = No . of moles  Volume of.pdf                     We know that Molarity = No . of moles  Volume of.pdf
We know that Molarity = No . of moles Volume of.pdfaparnatiwari291
 
there are no molecules given..pls repost and post.pdf
                     there are no molecules given..pls repost and post.pdf                     there are no molecules given..pls repost and post.pdf
there are no molecules given..pls repost and post.pdfaparnatiwari291
 
The false statement is Oxygen forms binary compou.pdf
                     The false statement is Oxygen forms binary compou.pdf                     The false statement is Oxygen forms binary compou.pdf
The false statement is Oxygen forms binary compou.pdfaparnatiwari291
 
the concentration is 0.1550 .pdf
                     the concentration is 0.1550                      .pdf                     the concentration is 0.1550                      .pdf
the concentration is 0.1550 .pdfaparnatiwari291
 
The area is how many Hydrogens are on the graph. .pdf
                     The area is how many Hydrogens are on the graph. .pdf                     The area is how many Hydrogens are on the graph. .pdf
The area is how many Hydrogens are on the graph. .pdfaparnatiwari291
 
SO4{2-} (aq) + Sn{2+} (aq) + 4 H{+} (aq)=========.pdf
                     SO4{2-} (aq) + Sn{2+} (aq) + 4 H{+} (aq)=========.pdf                     SO4{2-} (aq) + Sn{2+} (aq) + 4 H{+} (aq)=========.pdf
SO4{2-} (aq) + Sn{2+} (aq) + 4 H{+} (aq)=========.pdfaparnatiwari291
 
oxygen double bond oxygen .pdf
                     oxygen double bond oxygen                        .pdf                     oxygen double bond oxygen                        .pdf
oxygen double bond oxygen .pdfaparnatiwari291
 
Once HCl is added in solution, the ions would dis.pdf
                     Once HCl is added in solution, the ions would dis.pdf                     Once HCl is added in solution, the ions would dis.pdf
Once HCl is added in solution, the ions would dis.pdfaparnatiwari291
 
its e1 OMe attacks at 3-position by transfer of a.pdf
                     its e1 OMe attacks at 3-position by transfer of a.pdf                     its e1 OMe attacks at 3-position by transfer of a.pdf
its e1 OMe attacks at 3-position by transfer of a.pdfaparnatiwari291
 
H and F are identical, you just need to rotate H .pdf
                     H and F are identical, you just need to rotate H .pdf                     H and F are identical, you just need to rotate H .pdf
H and F are identical, you just need to rotate H .pdfaparnatiwari291
 
From weakest to strongest A, B, C Butanal is an .pdf
                     From weakest to strongest A, B, C Butanal is an .pdf                     From weakest to strongest A, B, C Butanal is an .pdf
From weakest to strongest A, B, C Butanal is an .pdfaparnatiwari291
 
Effusion is inversely proportional to the mass. .pdf
                     Effusion is inversely proportional to the mass.  .pdf                     Effusion is inversely proportional to the mass.  .pdf
Effusion is inversely proportional to the mass. .pdfaparnatiwari291
 
Benzoin and methanol both have an alcohol group, .pdf
                     Benzoin and methanol both have an alcohol group, .pdf                     Benzoin and methanol both have an alcohol group, .pdf
Benzoin and methanol both have an alcohol group, .pdfaparnatiwari291
 
When acid and base react together they form salt and water.This reac.pdf
When acid and base react together they form salt and water.This reac.pdfWhen acid and base react together they form salt and water.This reac.pdf
When acid and base react together they form salt and water.This reac.pdfaparnatiwari291
 
There are 37 classes in java.lang package as per Java SE7 The java.pdf
There are 37 classes in java.lang package as per Java SE7 The java.pdfThere are 37 classes in java.lang package as per Java SE7 The java.pdf
There are 37 classes in java.lang package as per Java SE7 The java.pdfaparnatiwari291
 
The precations to be given to the workers areSolutionThe prec.pdf
The precations to be given to the workers areSolutionThe prec.pdfThe precations to be given to the workers areSolutionThe prec.pdf
The precations to be given to the workers areSolutionThe prec.pdfaparnatiwari291
 
At 1700 cm-1 a strong signal in an IR spectum is .pdf
                     At 1700 cm-1 a strong signal in an IR spectum is .pdf                     At 1700 cm-1 a strong signal in an IR spectum is .pdf
At 1700 cm-1 a strong signal in an IR spectum is .pdfaparnatiwari291
 

More from aparnatiwari291 (20)

When two data sets are pooled together the pooled mean will alway.pdf
 When two data sets are pooled together the pooled mean will alway.pdf When two data sets are pooled together the pooled mean will alway.pdf
When two data sets are pooled together the pooled mean will alway.pdf
 
DELTOID flexes and medially rotates arm; prime mover of arm abduct.pdf
  DELTOID  flexes and medially rotates arm; prime mover of arm abduct.pdf  DELTOID  flexes and medially rotates arm; prime mover of arm abduct.pdf
DELTOID flexes and medially rotates arm; prime mover of arm abduct.pdf
 
Event Cash Flow   Assets Claims Income Statement OAIAFA Cash.pdf
    Event Cash Flow   Assets  Claims Income Statement    OAIAFA Cash.pdf    Event Cash Flow   Assets  Claims Income Statement    OAIAFA Cash.pdf
Event Cash Flow   Assets Claims Income Statement OAIAFA Cash.pdf
 
We know that Molarity = No . of moles Volume of.pdf
                     We know that Molarity = No . of moles  Volume of.pdf                     We know that Molarity = No . of moles  Volume of.pdf
We know that Molarity = No . of moles Volume of.pdf
 
there are no molecules given..pls repost and post.pdf
                     there are no molecules given..pls repost and post.pdf                     there are no molecules given..pls repost and post.pdf
there are no molecules given..pls repost and post.pdf
 
The false statement is Oxygen forms binary compou.pdf
                     The false statement is Oxygen forms binary compou.pdf                     The false statement is Oxygen forms binary compou.pdf
The false statement is Oxygen forms binary compou.pdf
 
the concentration is 0.1550 .pdf
                     the concentration is 0.1550                      .pdf                     the concentration is 0.1550                      .pdf
the concentration is 0.1550 .pdf
 
The area is how many Hydrogens are on the graph. .pdf
                     The area is how many Hydrogens are on the graph. .pdf                     The area is how many Hydrogens are on the graph. .pdf
The area is how many Hydrogens are on the graph. .pdf
 
SO4{2-} (aq) + Sn{2+} (aq) + 4 H{+} (aq)=========.pdf
                     SO4{2-} (aq) + Sn{2+} (aq) + 4 H{+} (aq)=========.pdf                     SO4{2-} (aq) + Sn{2+} (aq) + 4 H{+} (aq)=========.pdf
SO4{2-} (aq) + Sn{2+} (aq) + 4 H{+} (aq)=========.pdf
 
oxygen double bond oxygen .pdf
                     oxygen double bond oxygen                        .pdf                     oxygen double bond oxygen                        .pdf
oxygen double bond oxygen .pdf
 
Once HCl is added in solution, the ions would dis.pdf
                     Once HCl is added in solution, the ions would dis.pdf                     Once HCl is added in solution, the ions would dis.pdf
Once HCl is added in solution, the ions would dis.pdf
 
its e1 OMe attacks at 3-position by transfer of a.pdf
                     its e1 OMe attacks at 3-position by transfer of a.pdf                     its e1 OMe attacks at 3-position by transfer of a.pdf
its e1 OMe attacks at 3-position by transfer of a.pdf
 
H and F are identical, you just need to rotate H .pdf
                     H and F are identical, you just need to rotate H .pdf                     H and F are identical, you just need to rotate H .pdf
H and F are identical, you just need to rotate H .pdf
 
From weakest to strongest A, B, C Butanal is an .pdf
                     From weakest to strongest A, B, C Butanal is an .pdf                     From weakest to strongest A, B, C Butanal is an .pdf
From weakest to strongest A, B, C Butanal is an .pdf
 
Effusion is inversely proportional to the mass. .pdf
                     Effusion is inversely proportional to the mass.  .pdf                     Effusion is inversely proportional to the mass.  .pdf
Effusion is inversely proportional to the mass. .pdf
 
Benzoin and methanol both have an alcohol group, .pdf
                     Benzoin and methanol both have an alcohol group, .pdf                     Benzoin and methanol both have an alcohol group, .pdf
Benzoin and methanol both have an alcohol group, .pdf
 
When acid and base react together they form salt and water.This reac.pdf
When acid and base react together they form salt and water.This reac.pdfWhen acid and base react together they form salt and water.This reac.pdf
When acid and base react together they form salt and water.This reac.pdf
 
There are 37 classes in java.lang package as per Java SE7 The java.pdf
There are 37 classes in java.lang package as per Java SE7 The java.pdfThere are 37 classes in java.lang package as per Java SE7 The java.pdf
There are 37 classes in java.lang package as per Java SE7 The java.pdf
 
The precations to be given to the workers areSolutionThe prec.pdf
The precations to be given to the workers areSolutionThe prec.pdfThe precations to be given to the workers areSolutionThe prec.pdf
The precations to be given to the workers areSolutionThe prec.pdf
 
At 1700 cm-1 a strong signal in an IR spectum is .pdf
                     At 1700 cm-1 a strong signal in an IR spectum is .pdf                     At 1700 cm-1 a strong signal in an IR spectum is .pdf
At 1700 cm-1 a strong signal in an IR spectum is .pdf
 

Recently uploaded

KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
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
 
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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
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
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupJonathanParaisoCruz
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Recently uploaded (20)

KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
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
 
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
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
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)
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
MARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized GroupMARGINALIZATION (Different learners in Marginalized Group
MARGINALIZATION (Different learners in Marginalized Group
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 

The solution is as belowEmployeeDemo.javaimport java.util.Scann.pdf

  • 1. The solution is as below: EmployeeDemo.java import java.util.Scanner; public class EmployeeDemo { static Scanner scan = new Scanner(System.in); public static void main(String[] args) { Company clerk = new Company( ); Employee employee = new Employee();// one student int count,dependent; String fname,lname; float hourly_rate,no_of_hours,l_tax,f_tax,s_tax; System.out.println("Enter number of employees:"); int numberOfEmployees = scan.nextInt(); for (count = 0; count < numberOfEmployees; count++) { System.out.println("Enter data for employee number " + count); System.out.println("First Name "); fname = scan.next(); System.out.println("Last Name "); lname = scan.next(); System.out.println("Number of dependents "); dependent = scan.nextInt(); System.out.println("Hourly rate "); hourly_rate = scan.nextFloat(); System.out.println("Number of hours worked "); no_of_hours = scan.nextFloat(); System.out.println("Local tax withheld to date "); l_tax = scan.nextFloat(); System.out.println("Federal tax withheld to date "); f_tax = scan.nextFloat(); System.out.println("State tax withheld to date "); s_tax = scan.nextFloat();
  • 2. employee.readInput(fname,lname,dependent,hourly_rate,no_of_hours,l_tax,f_tax,s_tax); employee.calculateData(count); employee.writeOutput(count); clerk.colectDataForCompanyReport(employee,count); } clerk.printDataForCompanyReport(); } } Employee.java import java.util.ArrayList; public class Employee { private ArrayList fname,lname; private ArrayList dependent; private ArrayList hourly_rate,no_of_hours,l_tax,f_tax,s_tax,g_wages,cf_tax,cl_tax,cs_tax,t_tax,ct_tax,net_pay; public Employee(){ fname = new ArrayList(); lname = new ArrayList(); dependent = new ArrayList(); hourly_rate = new ArrayList(); no_of_hours = new ArrayList(); l_tax = new ArrayList(); f_tax = new ArrayList(); s_tax = new ArrayList(); g_wages = new ArrayList(); cl_tax = new ArrayList(); cf_tax = new ArrayList(); cs_tax = new ArrayList(); t_tax = new ArrayList(); ct_tax = new ArrayList(); net_pay = new ArrayList(); }
  • 3. public ArrayList getFname() { return fname; } public void setFname(ArrayList fname) { this.fname = fname; } public ArrayList getLname() { return lname; } public void setLname(ArrayList lname) { this.lname = lname; } public ArrayList getDependent() { return dependent; } public void setDependent(ArrayList dependent) { this.dependent = dependent; } public ArrayList getHourly_rate() { return hourly_rate; } public void setHourly_rate(ArrayList hourly_rate) { this.hourly_rate = hourly_rate; } public ArrayList getNo_of_hours() { return no_of_hours; } public void setNo_of_hours(ArrayList no_of_hours) { this.no_of_hours = no_of_hours; } public ArrayList getL_tax() { return l_tax; } public void setL_tax(ArrayList l_tax) { this.l_tax = l_tax;
  • 4. } public ArrayList getF_tax() { return f_tax; } public void setF_tax(ArrayList f_tax) { this.f_tax = f_tax; } public ArrayList getS_tax() { return s_tax; } public void setS_tax(ArrayList s_tax) { this.s_tax = s_tax; } public ArrayList getG_wages() { return g_wages; } public void setG_wages(ArrayList g_wages) { this.g_wages = g_wages; } public ArrayList getCf_tax() { return cf_tax; } public void setCf_tax(ArrayList cf_tax) { this.cf_tax = cf_tax; } public ArrayList getCl_tax() { return cl_tax; } public void setCl_tax(ArrayList cl_tax) { this.cl_tax = cl_tax; } public ArrayList getCs_tax() { return cs_tax; } public void setCs_tax(ArrayList cs_tax) { this.cs_tax = cs_tax;
  • 5. } public ArrayList getT_tax() { return t_tax; } public void setT_tax(ArrayList t_tax) { this.t_tax = t_tax; } public ArrayList getCt_tax() { return ct_tax; } public void setCt_tax(ArrayList ct_tax) { this.ct_tax = ct_tax; } public ArrayList getNet_pay() { return net_pay; } public void setNet_pay(ArrayList net_pay) { this.net_pay = net_pay; } public void readInput(String fname2, String lname2, int dependent2, float hourly_rate2, float no_of_hours2, float l_tax2, float f_tax2, float s_tax2){ this.fname.add(fname2); this.lname.add(lname2); this.dependent.add(dependent2); this.hourly_rate.add(hourly_rate2); this.no_of_hours.add(no_of_hours2); this.l_tax.add(l_tax2); this.f_tax.add(f_tax2); this.s_tax.add(s_tax2); } public void writeOutput(int i){ System.out.println("Employee: " + fname.get(i) + " " + lname.get(i)); System.out.println("Hours Worked: " + no_of_hours.get(i)); System.out.println("Hourly Rate: " + hourly_rate.get(i)); System.out.println("Gross Wages: " + g_wages.get(i));
  • 6. System.out.println("Current Yr. To Date"); System.out.println("Federal " + cf_tax.get(i) + " " + f_tax.get(i)); System.out.println("State " + cs_tax.get(i) + " " + s_tax.get(i)); System.out.println("Local " + cl_tax.get(i) + " " + l_tax.get(i)); System.out.println("Total Deductions " + ct_tax.get(i)); System.out.println("Net Pay " + net_pay.get(i)); } public void calculateData(int i) { // TODO Auto-generated method stub float f_tax,g_pay,temp,annual_pay,tax_percent,l_tax,temp2,s_tax,f_tax1,s_tax1,l_tax1,t_tax; g_pay = this.hourly_rate.get(i) * this.no_of_hours.get(i); temp = g_pay - (15 * this.dependent.get(i)); annual_pay = temp * 52; if(annual_pay > 40000) tax_percent = 0.3f; else if(annual_pay > 20000 && annual_pay < 40000) tax_percent = 0.2f; else tax_percent = 0.1f; f_tax = temp * tax_percent; l_tax = (float) (g_pay * 0.0115); temp2 = this.l_tax.get(i) + l_tax; if(temp2 > 517.50){ l_tax = (float) (517.50 - this.l_tax.get(i)); } if(annual_pay > 30000) tax_percent = 0.1f; else tax_percent = 0.05f;
  • 7. s_tax = temp * tax_percent; f_tax1 = this.f_tax.get(i); s_tax1 = this.s_tax.get(i); l_tax1 = this.l_tax.get(i); this.g_wages.add(g_pay); this.cf_tax.add(f_tax); this.cl_tax.add(l_tax); this.s_tax.add(s_tax); this.f_tax.set(i, (f_tax + f_tax1)); this.s_tax.set(i, (s_tax + s_tax1)); this.l_tax.set(i, (l_tax + l_tax1)); this.ct_tax.add(f_tax + l_tax + s_tax); this.net_pay.add(g_pay - (f_tax + l_tax + s_tax)); t_tax = this.s_tax.get(i) + this.f_tax.get(i) + this.l_tax.get(i); this.t_tax.add(t_tax); } } Company.java public class Company { private float f_tax,s_tax,t_deduction,g_wages,net_pay,cf_tax,cs_tax,ct_deduction; public float getF_tax() { return f_tax; } public void setF_tax(float f_tax) { this.f_tax = f_tax; } public float getS_tax() { return s_tax; } public void setS_tax(float s_tax) { this.s_tax = s_tax;
  • 8. } public float getT_deduction() { return t_deduction; } public void setT_deduction(float t_deduction) { this.t_deduction = t_deduction; } public float getG_wages() { return g_wages; } public void setG_wages(float g_wages) { this.g_wages = g_wages; } public float getNet_pay() { return net_pay; } public void setNet_pay(float net_pay) { this.net_pay = net_pay; } public float getCf_tax() { return cf_tax; } public void setCf_tax(float cf_tax) { this.cf_tax = cf_tax; } public float getCs_tax() { return cs_tax; } public void setCs_tax(float cs_tax) { this.cs_tax = cs_tax; } public float getCt_deduction() { return ct_deduction; } public void setCt_deduction(float ct_deduction) { this.ct_deduction = ct_deduction;
  • 9. } public void colectDataForCompanyReport(Employee employee, int i) { // TODO Auto-generated method stub for(int j=0 ; j Solution The solution is as below: EmployeeDemo.java import java.util.Scanner; public class EmployeeDemo { static Scanner scan = new Scanner(System.in); public static void main(String[] args) { Company clerk = new Company( ); Employee employee = new Employee();// one student int count,dependent; String fname,lname; float hourly_rate,no_of_hours,l_tax,f_tax,s_tax; System.out.println("Enter number of employees:"); int numberOfEmployees = scan.nextInt(); for (count = 0; count < numberOfEmployees; count++) { System.out.println("Enter data for employee number " + count); System.out.println("First Name "); fname = scan.next(); System.out.println("Last Name "); lname = scan.next(); System.out.println("Number of dependents "); dependent = scan.nextInt(); System.out.println("Hourly rate "); hourly_rate = scan.nextFloat(); System.out.println("Number of hours worked "); no_of_hours = scan.nextFloat(); System.out.println("Local tax withheld to date "); l_tax = scan.nextFloat();
  • 10. System.out.println("Federal tax withheld to date "); f_tax = scan.nextFloat(); System.out.println("State tax withheld to date "); s_tax = scan.nextFloat(); employee.readInput(fname,lname,dependent,hourly_rate,no_of_hours,l_tax,f_tax,s_tax); employee.calculateData(count); employee.writeOutput(count); clerk.colectDataForCompanyReport(employee,count); } clerk.printDataForCompanyReport(); } } Employee.java import java.util.ArrayList; public class Employee { private ArrayList fname,lname; private ArrayList dependent; private ArrayList hourly_rate,no_of_hours,l_tax,f_tax,s_tax,g_wages,cf_tax,cl_tax,cs_tax,t_tax,ct_tax,net_pay; public Employee(){ fname = new ArrayList(); lname = new ArrayList(); dependent = new ArrayList(); hourly_rate = new ArrayList(); no_of_hours = new ArrayList(); l_tax = new ArrayList(); f_tax = new ArrayList(); s_tax = new ArrayList(); g_wages = new ArrayList(); cl_tax = new ArrayList(); cf_tax = new ArrayList(); cs_tax = new ArrayList(); t_tax = new ArrayList();
  • 11. ct_tax = new ArrayList(); net_pay = new ArrayList(); } public ArrayList getFname() { return fname; } public void setFname(ArrayList fname) { this.fname = fname; } public ArrayList getLname() { return lname; } public void setLname(ArrayList lname) { this.lname = lname; } public ArrayList getDependent() { return dependent; } public void setDependent(ArrayList dependent) { this.dependent = dependent; } public ArrayList getHourly_rate() { return hourly_rate; } public void setHourly_rate(ArrayList hourly_rate) { this.hourly_rate = hourly_rate; } public ArrayList getNo_of_hours() { return no_of_hours; } public void setNo_of_hours(ArrayList no_of_hours) { this.no_of_hours = no_of_hours; }
  • 12. public ArrayList getL_tax() { return l_tax; } public void setL_tax(ArrayList l_tax) { this.l_tax = l_tax; } public ArrayList getF_tax() { return f_tax; } public void setF_tax(ArrayList f_tax) { this.f_tax = f_tax; } public ArrayList getS_tax() { return s_tax; } public void setS_tax(ArrayList s_tax) { this.s_tax = s_tax; } public ArrayList getG_wages() { return g_wages; } public void setG_wages(ArrayList g_wages) { this.g_wages = g_wages; } public ArrayList getCf_tax() { return cf_tax; } public void setCf_tax(ArrayList cf_tax) { this.cf_tax = cf_tax; } public ArrayList getCl_tax() { return cl_tax; } public void setCl_tax(ArrayList cl_tax) { this.cl_tax = cl_tax; }
  • 13. public ArrayList getCs_tax() { return cs_tax; } public void setCs_tax(ArrayList cs_tax) { this.cs_tax = cs_tax; } public ArrayList getT_tax() { return t_tax; } public void setT_tax(ArrayList t_tax) { this.t_tax = t_tax; } public ArrayList getCt_tax() { return ct_tax; } public void setCt_tax(ArrayList ct_tax) { this.ct_tax = ct_tax; } public ArrayList getNet_pay() { return net_pay; } public void setNet_pay(ArrayList net_pay) { this.net_pay = net_pay; } public void readInput(String fname2, String lname2, int dependent2, float hourly_rate2, float no_of_hours2, float l_tax2, float f_tax2, float s_tax2){ this.fname.add(fname2); this.lname.add(lname2); this.dependent.add(dependent2); this.hourly_rate.add(hourly_rate2); this.no_of_hours.add(no_of_hours2); this.l_tax.add(l_tax2); this.f_tax.add(f_tax2); this.s_tax.add(s_tax2); }
  • 14. public void writeOutput(int i){ System.out.println("Employee: " + fname.get(i) + " " + lname.get(i)); System.out.println("Hours Worked: " + no_of_hours.get(i)); System.out.println("Hourly Rate: " + hourly_rate.get(i)); System.out.println("Gross Wages: " + g_wages.get(i)); System.out.println("Current Yr. To Date"); System.out.println("Federal " + cf_tax.get(i) + " " + f_tax.get(i)); System.out.println("State " + cs_tax.get(i) + " " + s_tax.get(i)); System.out.println("Local " + cl_tax.get(i) + " " + l_tax.get(i)); System.out.println("Total Deductions " + ct_tax.get(i)); System.out.println("Net Pay " + net_pay.get(i)); } public void calculateData(int i) { // TODO Auto-generated method stub float f_tax,g_pay,temp,annual_pay,tax_percent,l_tax,temp2,s_tax,f_tax1,s_tax1,l_tax1,t_tax; g_pay = this.hourly_rate.get(i) * this.no_of_hours.get(i); temp = g_pay - (15 * this.dependent.get(i)); annual_pay = temp * 52; if(annual_pay > 40000) tax_percent = 0.3f; else if(annual_pay > 20000 && annual_pay < 40000) tax_percent = 0.2f; else tax_percent = 0.1f; f_tax = temp * tax_percent; l_tax = (float) (g_pay * 0.0115); temp2 = this.l_tax.get(i) + l_tax; if(temp2 > 517.50){ l_tax = (float) (517.50 - this.l_tax.get(i)); }
  • 15. if(annual_pay > 30000) tax_percent = 0.1f; else tax_percent = 0.05f; s_tax = temp * tax_percent; f_tax1 = this.f_tax.get(i); s_tax1 = this.s_tax.get(i); l_tax1 = this.l_tax.get(i); this.g_wages.add(g_pay); this.cf_tax.add(f_tax); this.cl_tax.add(l_tax); this.s_tax.add(s_tax); this.f_tax.set(i, (f_tax + f_tax1)); this.s_tax.set(i, (s_tax + s_tax1)); this.l_tax.set(i, (l_tax + l_tax1)); this.ct_tax.add(f_tax + l_tax + s_tax); this.net_pay.add(g_pay - (f_tax + l_tax + s_tax)); t_tax = this.s_tax.get(i) + this.f_tax.get(i) + this.l_tax.get(i); this.t_tax.add(t_tax); } } Company.java public class Company { private float f_tax,s_tax,t_deduction,g_wages,net_pay,cf_tax,cs_tax,ct_deduction; public float getF_tax() { return f_tax; } public void setF_tax(float f_tax) { this.f_tax = f_tax; }
  • 16. public float getS_tax() { return s_tax; } public void setS_tax(float s_tax) { this.s_tax = s_tax; } public float getT_deduction() { return t_deduction; } public void setT_deduction(float t_deduction) { this.t_deduction = t_deduction; } public float getG_wages() { return g_wages; } public void setG_wages(float g_wages) { this.g_wages = g_wages; } public float getNet_pay() { return net_pay; } public void setNet_pay(float net_pay) { this.net_pay = net_pay; } public float getCf_tax() { return cf_tax; } public void setCf_tax(float cf_tax) { this.cf_tax = cf_tax; } public float getCs_tax() { return cs_tax; } public void setCs_tax(float cs_tax) { this.cs_tax = cs_tax; }
  • 17. public float getCt_deduction() { return ct_deduction; } public void setCt_deduction(float ct_deduction) { this.ct_deduction = ct_deduction; } public void colectDataForCompanyReport(Employee employee, int i) { // TODO Auto-generated method stub for(int j=0 ; j