
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
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](https://content.bartleby.com/qna-images/question/4872eae1-fe4e-434e-aaf9-45c814476857/0b669087-1077-45f0-ad5e-2b7c7c368b2a/mn9miw_thumbnail.jpeg)
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

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 nowThis is a popular solution!
Step by stepSolved 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.Similar questions
- Write in javaarrow_forwardSuppose 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.…arrow_forwardIN JAVA Given an array, write a program to print the array elements one by one in a new line. If the array element is divisible by 4, print Four. If it is divisible by 6, print Six. If it is divisible by both 4 and 6, print Four Six. Use the following input array Int[] input_array = {2, 5, 10, 8, 18, 24, 3, 48, 30, 9, 12} Output should be 2 5 10 Four Six Four Six 3 Four Six Six 9 Four Sixarrow_forward
- Solve by javaarrow_forwardCheck if Array Elements are Consecutive in Java. Given an array, we need to check if array contains consecutive elements. For example: Input: array[] = {5, 3, 4, 1, 2} Output: true As array contains consecutive elements from 1 to 5 Input: array[] = {47, 43, 45, 44, 46} Output: true As array contains consecutive elements from 43 to 47 Input: array[] = {6, 7, 5, 6} Output: false As array does not contain consecutive elements.arrow_forwardIn java Define and create a 2-dimensional array of integers with 4 rows and 8 columns. Print the elements of the array in table format (rows and columns). Replace the element in the second row and third column of the array with the value 99.arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education

Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education

Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON

Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education