Wednesday, September 10, 2014
Natoinal Wedgits Payroll
public static void main(String[] args) {
double d_Employee1, d_Employee2, d_Employee3, d_Employee4, d_Employee5;
double hrs1 = 40, hrs2 = 24, hrs3 = 10, hrs4 = 5, hrs5 = 35;
double d_rate = 9.50, d_rate2 = 8.75, d_rate3 = 10.95, d_rate4 = 6.75, d_rate5 = 15.50;
double gross1, gross2, gross3, gross4, gross5;
double tax1, tax2, tax3, tax4, tax5;
double net1, net2, net3, net4, net5;
double Total_Gross, Total_tax, Total_net;
d_Employee1 = Double.parseDouble(JOptionPane.showInputDialog("Enter d_Employee1"));
d_Employee2 = Double.parseDouble(JOptionPane.showInputDialog("Enter d_Employee2"));
d_Employee3 = Double.parseDouble(JOptionPane.showInputDialog("Enter d_Employee3"));
d_Employee4 = Double.parseDouble(JOptionPane.showInputDialog("Enter d_Employee4"));
d_Employee5 = Double.parseDouble(JOptionPane.showInputDialog("Enter d_Employee5"));
d_rate = Double.parseDouble(JOptionPane.showInputDialog("Enter d_rate"));
d_rate2 = Double.parseDouble(JOptionPane.showInputDialog("Enter d_rate2"));
d_rate3 = Double.parseDouble(JOptionPane.showInputDialog("Enter d_rate3"));
d_rate4 = Double.parseDouble(JOptionPane.showInputDialog("Enter d_rate4"));
d_rate5 = Double.parseDouble(JOptionPane.showInputDialog("Enter d_rate5"));
gross1 = hrs1 * d_rate;
gross2 = hrs2 * d_rate2;
gross3 = hrs3 * d_rate3;
gross4 = hrs4 * d_rate4;
gross5 = hrs5 * d_rate5;
tax1 = .35 * gross1;
tax2 = .35 * gross2;
tax3 = .35 * gross3;
tax4 = .35 * gross4;
tax5 = .35 * gross5;
net1 = gross1 - tax1;
net2 = gross2 - tax2;
net3 = gross3 - tax3;
net4 = gross4 - tax4;
net5 = gross5 - tax5;
Total_Gross = gross1 + gross2 + gross3 + gross4 + gross5;
Total_tax = tax1 + tax2 + tax3 + tax4 + tax5;
Total_net = net1 + net2 + net3 + net4 + net5;
System.out.print("National Wiidgets");
System.out.println();
System.out.print("Payroll Report");
System.out.println();
System.out.print("Employee no.\t\t Hrs\t\t Rate\t\t Gross\t\t\t Tax\t\t\t Net");
System.out.println();
System.out.println("----------------------------------------------------------------------------------------------------------------------");
System.out.println(d_Employee1 + "\t\t\t" + hrs1 + "\t\t" + d_rate + "\t\t" + gross1 + "\t\t\t" + tax1 + "\t\t\t" + net1);
System.out.println();
System.out.println(d_Employee2 + "\t\t\t" + hrs2 + "\t\t" + d_rate2 + "\t\t" + gross2 + "\t\t\t" + tax2 + "\t\t\t" + net2);
System.out.println();
System.out.println(d_Employee3 + "\t\t\t" + hrs3 + "\t\t" + d_rate3 + "\t\t" + gross3 + "\t\t\t" + tax3 + "\t\t\t" + net3);
System.out.println();
System.out.println(d_Employee4 + "\t\t\t" + hrs4 + "\t\t" + d_rate4 + "\t\t" + gross4 + "\t\t\t" + tax4 + "\t\t\t" + net4);
System.out.println();
System.out.println(d_Employee5 + "\t\t\t" + hrs5 + "\t\t" + d_rate5 + "\t\t" + gross5 + "\t\t\t" + tax5 + "\t\t\t" + net5);
System.out.println("----------------------------------------------------------------------------------------------------------------------");
System.out.println();
Total_Gross = gross1 + gross2 + gross3 + gross4 + gross5;
Total_tax = tax1 + tax2 + tax3 + tax4 + tax5;
Total_net = net1 + net2 + net3 + net4 + net5;
System.out.println("\t\t\t\t\t\tTotal Gross is: " + Total_Gross + "\tTotal Tax is: " + Total_tax + "\tTotal Net is: " + Total_net);
}
}
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment