Following are three arrays, each containing 20 data. Array emp_hours contain the number of hours worked by 20 employees. Array emy_hourly_pay contain the hourly pay for the same 20 employees. Array emp_dependents contain the number of dependents for each of the same 20 employees.
double []emp_hours = {45, 40, 40, 42, 35, 40, 40, 50, 45, 35, 40, 40, 40, 30, 40, 40, 50, 45, 40, 40};
double []emp_hourly_pay = {15, 50, 32, 18, 20, 60, 25, 20, 30, 100, 20, 35, 30, 20, 50, 45, 25, 30, 55, 20};
double []emp_dependents = {0, 0, 5, 2, 7, 2, 2, 1, 0, 0, 3, 2, 4, 4, 5, 0, 1, 1, 2, 4};
Number of dependents
|
Taxable income (Gross pay gets reduced by following percentages)
|
0
|
0%
|
1
|
4%
|
2
|
7.75%
|
3
|
11.25%
|
4
|
14.5%
|
5
|
17.5%
|
6 and above
|
20.25%
|
Taxable Income
|
Tax Rate
|
0-500
|
10%
|
501-1000
|
15%
|
1001-1500
|
25%
|
1501-2000
|
40%
|
Above 2000
|
50%
|
1) Print the gross_income for all 20 employees.
2) Print the taxble income for all 20 employees.
3) Print the taxes for all 20 employees.
4) Print the net pay for all 20 employees.
Note: create an array for gross_pay, taxable_income, taxes, and net pay.