forked from Denisolt/CSCI-160
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPayroll.java
More file actions
34 lines (29 loc) · 1017 Bytes
/
Payroll.java
File metadata and controls
34 lines (29 loc) · 1017 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import java.util.*;
import java.text.DecimalFormat;
public class Payroll
{
public int employeeId[] = {5658845,4520125,7895122,8777541,8451277,1302850,7580489};
public int hours[] = {40, 41, 42, 43, 44, 45, 46};
public double payRate[] = {13.6, 13.5, 13.4, 13.3, 13.2, 13.1, 13.0};
public double wages[]= new double [7];
public static void main(String args[])
{
DecimalFormat df = new DecimalFormat("#.##");
Payroll t = new Payroll();
double [] w = t.getWage();
System.out.println("employeeID Hours payRate Wages");
for (int i =0; i<7;i++)
{
System.out.println(t.employeeId[i] + " "+t.hours[i]+ " " +t.payRate[i]+
" " +df.format(w[i]));
}
}
public double [] getWage()
{
for(int i=0;i<7;i++)
{
wages[i] = hours[i]*payRate[i];
}
return wages;
}
}