Question
please use parallel arrays and a loop to complete both problems Must use a loop to capture each employee's input individually. The following is not
please use parallel arrays and a loop to complete both problems
Must use a loop to capture each employee's input individually.
The following is not allowed
input salary[], hoursWorked[], dept[]
The input line above assumes that the input is parallel arrays already organized. Understand the data is entered in the system by employee data and that the information must put in the correct parallel array and at the right index in each array.
For example, assume the input for each employee is as follows:
Last name, first name, dept #, hourly pay, and # of hours worked
"Wright-Hamor", "Cimone", 4, 52, 40
The assignment will require the declaration of an array of unknown size, as shown below
String employeeNames[]
7. a. Design the logic for a company application that breaks down payroll by the department. Input includes each employees last name, first name, department number, hourly salary, and the number of hours worked. The output is a list of the seven departments in the company (numbered 1 through 7) and the total gross payroll (rate times hours) for each department.
Example output should be as follows:
1: 5648
2: 51688
3: 546983
4: 893166
5: 234689
6: 194136
7: 46813549
b. Modify Exercise 7a so that the report lists department names as well as numbers. The department names are shown in Table 5-3.
Example output should be as follows:
Personnel,1: 5648
Marketing, 2: 51688
Manufacturing, 3: 546983
Computer Services, 4: 893166
Sales, 5: 234689
Accounting, 6: 194136
Shipping, 7: 46813549
Note: The final gross pay values will not be as shown above.
Department Number Department Name Personnel Marketing Manufacturing Computer Services Sales Accounting Shipping Department names Table 5-3 Department Number Department Name Personnel Marketing Manufacturing Computer Services Sales Accounting Shipping Department names Table 5-3
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started