Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can anyone help me to solve this problem? 1. Encik Abdurrahman Auf is the owner of Restaurant Wau. The restaurant is open daily. At the
Can anyone help me to solve this problem?
1. Encik Abdurrahman Auf is the owner of Restaurant Wau. The restaurant is open daily. At the end of each month, he needs to calculate salary for all his employee based on the number of working hours daily. Each employee should have different similar working days. The payment rate per hour is RM10.00. Suppose the monthly working hours for all employees are stored in two dimensional array. Each row records an employee working hours with column represents the working days. The example of two dimensional array structure is shown in Figure 3 in which it stores the working hours of maximum 10 working days for 4 employees. Employee 0 Employee 1 Employee 2 Employee 3 Day 0 T 2 I 4 1 3 1 4 Day 1 Day 2 Day 3 Day 4 Day 5 Day 6 Day 7 Day 8 Day 9 7 3 7 2 8 7 6 4 8 4 4 5 5 8 3 7 9 1 8 5 4 3 1 1 3 5 6 5 1 3 3 1 5 1 4 4 9 Figure 3 1 w Write a Java program that should be able to: i. read the number of employee, number of working days for each employee and working hours for each day for each employee and store the values in two dimensional array, employeeWorkHours. The declaration is shown below. int[] [] employeeWorkHours = [noEmployee) (noofWorkingDayl ii. calculate the total working hours for each employee using method header as below. calculateTotalworkingHours (int[] [] public static int[] workHours) iii. calculate the salary for each employee using method header as below: (int[] public static double[] calculateSalary totalworkHours, double payRate PerHour) iv. displays the total working hours and salary of the month for all employees. The example of the input and output is shown below. Number of employees: 2 Number of working days: 3 Employee 1 Working hours for day 1: 2 Working hours for day 2: 7 Working hours for day 2: 3 Employee 2 Working hours for day 1: 4 Working hours for day 2: 8 Working hours for day 8: 4 Total working hours for employee 1: 12 Total working hours for employee 2: 16 Salary: RM120.0 Salary: RM160.0 [20 Marks]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