subject

In this question, you will use loops and methods to generalize the work you did in Assignment 1. Basically, you will make your Assignment 1's program process an arbitrary number of employee. Moreover, you will use methods modularize your code. Your need to implement the following two methods that will be used in your program: 1. calculatePay: this method takes two numeric input parameters that represent hourlyPay (of type double) and numberOfHours (of type int). The method then calculates and return the employee's pay. Note that the company pays 1.5 for hours above 10 hours. For example, if an employee's hourly pay is 20 and the employee worked 10 hours, then the net pay for that employee is 200 (20*10). On the other hand, if the employee worked 15 hours for the same hourly pay, then the employee's net pay will be 350 (10*20 5*20*1.5).
2. calculateTax: this method takes one double input parameter that represents the employee's pay. The method then calculates and returns the tax to be deducted from that employee using the following rules:
a. no tax will be deducted for pay <= 500.
b. 5% tax will be deducted for pay > 500 and <= 1500
c. 7% tax will be deducted for pay > 1500.
Follow the following steps in implement your main method:
1. Ask the use to enter the number of employees to be processed and read this number.
2. Make a loop where the number of iterations is equal to the number of employees and each iteration in the loop does the following:
a. Ask the user to enter the employee's hourly rate and read the number
b. Ask the user to enter the employee's hours worked and read the number
c. Call the calculatePay method that returns the employee's pay before tax
d. Use the output that is returned by the calculatePay method as input to calculateTax method to find the tax to be deducted from that employee.
e. Print the employee's pay check details
Enter number of employees: 3
Employee #1
Hourly rate:
20
Hours:
20
Pay: 500.0
Tax: 0.00
Net pay: 500.00

Employee #2
Hourly rate:
20
Hours:
40
Pay: 1100.0
Tax: 55.00
Net pay: 1045.00
Employee #3
Hourly rate:
30
Hours:
40
Pay: 1650.0
Tax: 115.50
Net pay: 1534.50

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 14:20
Cengagenowv2 is a comprehensive online learning tool. using cengagenowv2, you may access all of the following except: 2. each time you log in, cengagenowv2 automatically performs a system check and informs you if your computer does not meet the cengagenowv2 system requirements. 3. which tab/page allows you to easily track your assignment scores, number of submissions, time spent, as well as the ability view assign
Answers: 3
question
Computers and Technology, 23.06.2019 17:00
In which of the following ways can using test-taking tips you? a. you can focus on the information that you need to study. b. you will see the answers to the test. c. you will study more. d. you will be less organized.
Answers: 1
question
Computers and Technology, 24.06.2019 01:00
Mastercard managers are motivated to increase (1) the number of individuals who have and use a mastercard credit card, (2) the number of banks and other clents who issue mastercards to customers and/or employees, and (3) the number of locations that accept mastercard payments. discuss how mastercard could use its data warehouse to it expand each of these customer bases.
Answers: 3
question
Computers and Technology, 25.06.2019 00:00
To remove text from a specific location and keep it to use again, you should select
Answers: 1
You know the right answer?
In this question, you will use loops and methods to generalize the work you did in Assignment 1. Bas...
Questions
question
Mathematics, 02.02.2021 17:30
question
Mathematics, 02.02.2021 17:30
question
Mathematics, 02.02.2021 17:30
question
Computers and Technology, 02.02.2021 17:30
question
Mathematics, 02.02.2021 17:30
Questions on the website: 13722367