Employeel 0 Employee2 17 Employee3 23 Su MTW Th F Sa Su 32 2 34 32 213 4 734 3. 4 3 4 3 Employee4 3 934 7 3 Employees 7 8686 Employee6 5 3 4 46 374 8 635 2 le 8 7 34 4 4 Employee76 Employee8 7 38 27 nat user to enter mumber of employees
Employeel 0 Employee2 17 Employee3 23 Su MTW Th F Sa Su 32 2 34 32 213 4 734 3. 4 3 4 3 Employee4 3 934 7 3 Employees 7 8686 Employee6 5 3 4 46 374 8 635 2 le 8 7 34 4 4 Employee76 Employee8 7 38 27 nat user to enter mumber of employees
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
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 MTW Th F Sa Su
Employeel 0
Employee2 1
Employee3 2
Employee4 3
Employees 7
Employee6 5
Employee7 6
Employee8 7
52 2
2 13
7 34
4
3.
4
4
34
9 34
6 8
3
3.
32
2
by Java code
3
4
6.
3 4 4 6 3 4
374 8 3 8
6 35 9
87
4
4
27
Write a program that
Prompt the user to enter number 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
* 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
• 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(intf] tHrs)
double avgWage(double(] wages) int aboveAvg(double(] wages, double avg) boolean search( String name)
String(] barChart(int() hDist )
int(] calTotalFHrs(int(] hrs)
printStr(String(] str)
int [) hoursDist(intf] tHrs)
int activeEmployee(int(] tHrs)
End of question](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F3bbb5e3d-2216-4c04-949c-a7baf5790fa1%2Fc2b79406-0903-49ee-9a3d-06c99c474c33%2Fs4g4nwt_processed.jpeg&w=3840&q=75)
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 MTW Th F Sa Su
Employeel 0
Employee2 1
Employee3 2
Employee4 3
Employees 7
Employee6 5
Employee7 6
Employee8 7
52 2
2 13
7 34
4
3.
4
4
34
9 34
6 8
3
3.
32
2
by Java code
3
4
6.
3 4 4 6 3 4
374 8 3 8
6 35 9
87
4
4
27
Write a program that
Prompt the user to enter number 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
* 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
• 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(intf] tHrs)
double avgWage(double(] wages) int aboveAvg(double(] wages, double avg) boolean search( String name)
String(] barChart(int() hDist )
int(] calTotalFHrs(int(] hrs)
printStr(String(] str)
int [) hoursDist(intf] tHrs)
int activeEmployee(int(] tHrs)
End of question
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps with 2 images

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY