Question: Design and implement a Java program ( name it WeeklyHours ) to compute the total weekly hours for 3 employees. A 2 D - Array

Design and implement a Java program (name it WeeklyHours) to compute the total weekly hours for 3 employees. A 2D-Array of size 3x7 is used to store employers daily hours. Each row represents one employee and each column represent one day of the week such that column 0 designates Monday, column 1 designates Tuesday, etc. The main method populates the array with random numbers between 0 and 10 and then prints out the array in rows and columns as shown below with proper row and column labels. The main method then calls another method (name it addHours) that takes the 2D-Array as a parameter and displays the total weekly hours for each employee as shown below with proper column labels. Design the main method such that it allows the user to re-run the program with different values (as in previous assignments, using a sentinel loop). Document your code and organize and space the outputs properly using escape characters as shown in the following sample outputs. Make sure your code displays the outputs following the test data format below (with spaced, tabs, and blank lines): First test: Mon Tue Wed Thu Fri Sat Sun Employee15329657 Employee27685545 Employee31221587 Employee# Weekly Hours ----------------------------137240326 Second test: Mon Tue Wed Thu Fri Sat Sun Employee110272038 Employee25615142 Employee31526487 Employee# Weekly Hours ----------------------------132224333

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 Programming Questions!