i wrote an example for you. the code is not perfect, but runs without errors as long the input is correct. i hope, you got the idea, so you can enhance your own code.
import java.io.*;
public class ImLost {
public static void main(String[] args) {
double totalPay;
int hoursWorked[] = new int[5];
int totalHours = 0;
int payRate = 10;
double otPay;
int id = 0;
int otHours;
String PlumbersName = "";
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
// read the plumbers name, id and pay rate
try {
System.out.print("Enter Plumbers name: ");
PlumbersName = in.readLine();
System.out.print("Enter Plumbers id: ");
id = Integer.parseInt(in.readLine());
System.out.print("Enter Plumbers Pay Rate: ");
payRate = Integer.parseInt(in.readLine());
} catch (IOException e) {
System.out.println(e.getMessage());
}
// loop 5 times for reading the hours worked
for (int counter = 0; counter < hoursWorked.length; counter++) {
// initialize the array at element counter with 0
hoursWorked[counter] = 0;
System.out.print("Hours worked day " + (counter + 1) + ": ");
try {
hoursWorked[counter] = Integer.parseInt(in.readLine());
} catch (IOException e) {
System.out.println(e.getMessage());
}
}
for (int counter = 0; counter < hoursWorked.length; counter++) {
System.out
.println("Hours Worked " + counter + hoursWorked[counter]);
totalHours += hoursWorked[counter];
}
// workreport(), print plumbers parameters
System.out.println("Pay report for " + PlumbersName);
System.out.println("ID: " + id);
System.out.println("Pay rate: " + payRate);
// calculations
System.out.println("Total of hours worked: " + totalHours);
System.out.println("Average of hours worked: " + (totalHours / 5.0));
if (totalHours > 40) {
otHours = totalHours - 40;
otPay = otHours * (payRate * 1.5);
totalPay = otPay + (40 * payRate);
System.out.println("Total pay: " + totalPay);
} else {
System.out.println("Total pay: " + totalHours * payRate);
}
}
}