Question: package arreyreview; public class HoursAndPayAngela { public static void main(String[] args) { int [] [] hours = new int [7] [5]; for (int row =

package arreyreview;

public class HoursAndPayAngela {

public static void main(String[] args) {

int [] [] hours = new int [7] [5];

for (int row = 0; row < 7; row++){

for(int col = 0; col < 5; col++){

hours[row][col]= (int) (Math.random()*11);

System.out.print(hours[row][col]+" ");

}

System.out.println();

}

System.out.println();

int [] totalEmp = new int [5];

for (int col = 0; col < 5; col ++){

totalEmp[col] = 0;

for (int row = 0; row < 7; row ++){

totalEmp[col]+=hours[row][col];

}

System.out.println("Total for employee " + col + " is " + totalEmp[col] );

}

System.out.println();

int count = 0;

for(int row = 0; row < 7; row++){

count = 0;

for(int col = 0; col < 5; col ++){

if(hours[row][col]!=0)

count+= 1;

}

System.out.println("On day: " + row + " " + count + " workers worked.");

}

System.out.println();

}

}

a) If each employee was paid $20.5 per hour calculate and output the weekly earnings for each employee.

b) Calculate and output how much all employees earned together.

c) how many employees worked more than 5 hours on Saturday (day with index 6).

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!