Suppose the weekly hours for all employees are stored 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. Su MTW Th F Sa Su Employeel 0 2 13 4 52 2 Employee2 1 Employee3 2 734 34 3 2 34 8 7 3 4. By Java Со 334 3 34 9 7. Employees 7 868 6. Employee6 5344 6 344 3 74 6 359 279 Employee7 6 Employee8 7 8 38 4 Write a program that • Prompt the user to enter mumber of employees Prompt the user to enter the employees names and save their names in a one dimensional array. (Check for availability if name exist, no duplicate names) • For each employee, enter the seven-day work hours and save them in a two dimensional array Compute the total hours worked by each employee and save them in one dimensional array. Compute the wages of employees as follows: up to 40 hours per week the hour price is 20 otherwise the overtime hour price is 1.2 regular hour price. Design a menu to the user so that he can choose from as follows where the menu is presented to user as long as he does not select 5: 1. Display employee IS User entered employee name, Search for employee by name and display his wage and total hours 2. Display employees Show employee names in decreasing order of the total hours and their wages 3. Display most active employee • Employee with highest total hours 4. Display average wage and number of employees above average. 5. Display work statisties • i categories of total hours (0-19, 20-39, 40-49, =50} Count the number of employees in each category & Display total hours distribution as bar chart, total Hour distribution for the sample data given above is: 0-19 * • 20-39 **** 40-49 ** 50 6. Quit Notes Use Stepwise refinement. (break the problem into smaller manageable sub problems) Use methods in your code (modular code), some of them are listed here for your benefit double(] calWages(int( tirs) double avgWage(double(] wages) int aboveAvg(double(] wages, double avg) boolean search(String name) String] barChart(in(] hDist ) int] calTotalFirs(int() hrs) printStr(String(] str) int ( hoursDist(int(] tHrs) int activeEmployee(int(0 tHrs) End of question

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter6: Arrays
Section: Chapter Questions
Problem 17RQ
icon
Related questions
Question
Suppose the weekly hours for all employees are stored 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.
Su MT W Th F Sa Su
52 2
Employeel 0
Employee2 1
Employee3 2
213
734
34
9 34
6 8
34 4 6
374 8 38
6 35 9
4
3.
4
4
32
3 4
87
34
3.
2
By Java Code
Employees 7
Employee6 5
Employee7 6
Employees 7
6.
4
4
279
Write a program that
Prompt the user to enter mumber of employees
Prompt the user to enter the employees names and save their names in a one dimensional
array. (Check for availability if name exist, no duplicate names)
For each employee, enter the seven-day work hours and save them in a two dimensional
array.
Compute the total hours worked by each employee and save them in one dimensional array.
the wages of employees as follows:
up to 40 hours per week the hour price is 20
otherwise the overtime hour price is 1.2 regular hour price.
Design a menu to the user so that he can choose from as follows where the menu is presented
to user as long as he does not select 5:
1. Display employee
* User entered employee name, Search for employee by name and display his
wage and total hours
2. Display employees
Show employee names in decreasing order of the total hours and their wages
3. Display most active employee
• Employee with highest total hours
4. Display average wage and number of employees above average.
5. Dısplay work statistics
• 3 categories of total hours (0-19, 20-39, 40-49, >=50}
• Count the number of employees in each category & Display total hours
distribution as bar chart, total Hour distribution for the sample data given above is:
0-19 +
• 20-39 ****
40-49 **
6. Quit
Notes:
Use Stepwise refinement. (break the problem into smaller manageable sub problems)
Use methods in your code (modular code), some of them are listed here for your benefit:
double[] calWages(intf] tHrs)
double avgWage(double(] wages) int aboveAvg(double[] wages, double avg) boolean search(String name)
String(] barChart(int(] hDist )
int(] calTotalHrs(int(]] hrs)
printStr(String(] str)
int [) hoursDist(intf] tHrs)
int activeEmployee(int(0 Hrs)
End of question
Transcribed Image Text:Suppose the weekly hours for all employees are stored 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. Su MT W Th F Sa Su 52 2 Employeel 0 Employee2 1 Employee3 2 213 734 34 9 34 6 8 34 4 6 374 8 38 6 35 9 4 3. 4 4 32 3 4 87 34 3. 2 By Java Code Employees 7 Employee6 5 Employee7 6 Employees 7 6. 4 4 279 Write a program that Prompt the user to enter mumber of employees Prompt the user to enter the employees names and save their names in a one dimensional array. (Check for availability if name exist, no duplicate names) For each employee, enter the seven-day work hours and save them in a two dimensional array. Compute the total hours worked by each employee and save them in one dimensional array. the wages of employees as follows: up to 40 hours per week the hour price is 20 otherwise the overtime hour price is 1.2 regular hour price. Design a menu to the user so that he can choose from as follows where the menu is presented to user as long as he does not select 5: 1. Display employee * User entered employee name, Search for employee by name and display his wage and total hours 2. Display employees Show employee names in decreasing order of the total hours and their wages 3. Display most active employee • Employee with highest total hours 4. Display average wage and number of employees above average. 5. Dısplay work statistics • 3 categories of total hours (0-19, 20-39, 40-49, >=50} • Count the number of employees in each category & Display total hours distribution as bar chart, total Hour distribution for the sample data given above is: 0-19 + • 20-39 **** 40-49 ** 6. Quit Notes: Use Stepwise refinement. (break the problem into smaller manageable sub problems) Use methods in your code (modular code), some of them are listed here for your benefit: double[] calWages(intf] tHrs) double avgWage(double(] wages) int aboveAvg(double[] wages, double avg) boolean search(String name) String(] barChart(int(] hDist ) int(] calTotalHrs(int(]] hrs) printStr(String(] str) int [) hoursDist(intf] tHrs) int activeEmployee(int(0 Hrs) End of question
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Arrays
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage