Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

What are the objectives of Human resource planning ?

Answered: 1 week ago

Question

Explain the process of Human Resource Planning.

Answered: 1 week ago