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
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
Related questions
Question
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 2 steps with 3 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
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage