Computers and Technology

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

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 10:30, Twitches
This first part of the film shows the early history of motion pictures. how accurate do you think the portrayal of the early motion picture industry is? why? is historical accuracy important in films and theatre productions? explain. in the scene where don is going to the party (starting at time code 14: 51), we see a street scene as he first rides with cosmo and then with kathy. what aspects did the filmmaker include to make the scene look and feel like don, cosmo, and kathy are riding in a car on a street? think about elements such as scenery, sound, props, lighting, and so on. a "talkie" picture is shown starting around time code 21: 15. how does the audience in the film react to the "talkie"? what influence do audiences have on film and theatre performances? how do film and theatre actors influence audiences? in the musical scene with cosmo (starting at time code 27: 00), how does the actor use props? what is the result? do you think the use of props effectively fulfilled the artistic vision for this musical number? why or why not?
Answers: 1
image
Computers and Technology, 22.06.2019 18:30, yayamcneal05
Which cultural aspect does this type of song best portray? a german polka dance
Answers: 1
image
Computers and Technology, 22.06.2019 23:30, riah133
Creating "smart interfaces" in all sectors of industry, government, and the public arena is one of the fastest growing hct areas. these interfaces model, interpret, and analyze such human characteristics as speech, gesture, and vision. the field of biometrics, in which humans authenticate themselves to machines, is an area of considerable interest to hct practitioners. fingerprint scans are one of the most frequently used biometric options, and this article, biometric student identification: practical solutions for accountability & security in schools, makes a case for the implementation of fingerprint scans in schools. critique the article, and answer the following questions: according to the author, what are the main benefits of adopting fingerprint scans in schools for student identification? according to the author, what are the main drawbacks of adopting fingerprint scans in schools for student identification? do you agree with the author's assessment of the pl
Answers: 2
image
Computers and Technology, 23.06.2019 06:00, Disd112984
Which statement is true of web-based social media? a. they allow consumers to interact with and update content. b. they cannot be updated easily, as compared to print media. c. they are expensive to produce and maintain, as compared to print and television. d. they can exist independent of the internet.
Answers: 1
Do you know the correct answer?
In this question, you will use loops and methods to generalize the work you did in Assignment 1. Bas...

Questions in other subjects:

Konu
Mathematics, 03.04.2021 01:00