
Untitled
By: a guest on
Jun 22nd, 2012 | syntax:
None | size: 1.30 KB | hits: 14 | expires: Never
public class CalculatePayArray {
public static void main (String[] args) {
{
String[] name;
name = new String[9];
name[0] = "Smith";
name[1] = "Jones";
name[2] = "Acker";
name[3] = "Drury";
name[4] = "Maxwell";
name[5] = "Henry";
name[6] = "Collier";
name[7] = "Gross";
name[8] = "Newton";
double[] hours;
hours = new double[9];
hours[0] = 40;
hours[1] = 40;
hours[2] = 48;
hours[3] = 40;
hours[4] = 44;
hours[5] = 40;
hours[6] = 43;
hours[7] = 40;
hours[8] = 48;
double[] rate;
rate = new double[9];
rate[0] = 23.14;
rate[1] = 25.50;
rate[2] = 22.00;
rate[3] = 15.00;
rate[4] = 20.00;
rate[5] = 23.14;
rate[6] = 24.39;
rate[7] = 25.00;
rate[8] = 15.00;
double[] tax_rate;
tax_rate = new double[9];
tax_rate[0] = 0.35;
tax_rate[1] = 0.35;
tax_rate[2] = 0.30;
tax_rate[3] = 0.15;
tax_rate[4] = 0.25;
tax_rate[5] = 0.35;
tax_rate[6] = 0.35;
tax_rate[7] = 0.35;
tax_rate[8] = 0.15;
for (int i = 0; i < 9; ++i);
double gross_pay = (hours[0] * rate[0]);
double overtime;
if (hours[0] > 40)
{
overtime = (hours[0] - 40) * (rate[0] * 1.5);
}
else
{
overtime = 0;
}
system.out.println("The gross pay for" + name[0]);
system.out.println("is" + gross_pay);
}
}