Write a program that computes weekly hours for each employee. Store the weekly hours for all employees in a two-dimensional array. Each row records an employee's seven-day work hours with seven columns. For example, the following array stores the work hours for eight employees. Display employees and the total hours of each employee in decreasing order of the total hours. Su M T W Sa Employee0 2 4 3 4 8 Employeel 7 3 4 3 4 Employee2 3 3 4 3 2 Employee39 3 4 7 1 Employee4 3 5 4 3 8 Employee53 4 4 6 4 Employee6 3 7 4 8 4 Employee7 6 3 5 9 2 9 Requirements: 1. Design a method that takes the 2-D array of weekly hours of all employees as an input parameter, calculates the sum of the total hours of all employees and returns the total hour results in an array. 2. Design a method to sort the above returned array in Requirement 1 in descending order by selection sort. • Important: when sorting the array, the program should keep track of which employee corresponds to how many work hours. Therefore, you should store the employee information in an array and return it as a result of your sort method. 3. Design a method to display the results of employees and their total hours in decreasing order. The sample output for the above example is as follows: C:\WINDOWS\system32\.cmd.exe Employee?: 41 hours Employee6: 37 hours Employee: 34 hours Employee 4: 32 hours Employee3: 31 hours Employee5: 28 houre Employeel: 28 hours Employee2: 20 hours Press any key to continue 4. Design a main method that uses the short hand initializer to initialize the 2-D array of weekly hours of all employees and invokes all the three methods in Requirements 1-3 in a sequence. RS R 5 3 3 نیا نیا نیا نبات 3 6 3 3 F43 F 8 4 2 4 3 487
Write a program that computes weekly hours for each employee. Store the weekly hours for all employees in a two-dimensional array. Each row records an employee's seven-day work hours with seven columns. For example, the following array stores the work hours for eight employees. Display employees and the total hours of each employee in decreasing order of the total hours. Su M T W Sa Employee0 2 4 3 4 8 Employeel 7 3 4 3 4 Employee2 3 3 4 3 2 Employee39 3 4 7 1 Employee4 3 5 4 3 8 Employee53 4 4 6 4 Employee6 3 7 4 8 4 Employee7 6 3 5 9 2 9 Requirements: 1. Design a method that takes the 2-D array of weekly hours of all employees as an input parameter, calculates the sum of the total hours of all employees and returns the total hour results in an array. 2. Design a method to sort the above returned array in Requirement 1 in descending order by selection sort. • Important: when sorting the array, the program should keep track of which employee corresponds to how many work hours. Therefore, you should store the employee information in an array and return it as a result of your sort method. 3. Design a method to display the results of employees and their total hours in decreasing order. The sample output for the above example is as follows: C:\WINDOWS\system32\.cmd.exe Employee?: 41 hours Employee6: 37 hours Employee: 34 hours Employee 4: 32 hours Employee3: 31 hours Employee5: 28 houre Employeel: 28 hours Employee2: 20 hours Press any key to continue 4. Design a main method that uses the short hand initializer to initialize the 2-D array of weekly hours of all employees and invokes all the three methods in Requirements 1-3 in a sequence. RS R 5 3 3 نیا نیا نیا نبات 3 6 3 3 F43 F 8 4 2 4 3 487
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter10: Pointers
Section10.3: Pointer Arithmetic
Problem 4E
Related questions
Question
Need help writing the program and getting the same display result. Attatching the instruction with images.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 4 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT