Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with writing a method for findTaxes() Will compute and return taxes based on salary according to the following table. NOTE: This method

I need help with writing a method for

findTaxes() Will compute and return taxes based on salary according to the following table. NOTE: This method will not be interacting with the user.

Tax Bracket - Salary TaxRate
<=$250.00 18%
<=$550.00 23%
<=$1100.00 28%
otherwise 33%

This is the code for by program so far.

Thanks in advance.

public class employeeTXT {

public static void userInstruct() {

JOptionPane.showMessageDialog(null, "This program will take a .txt file from AvaCams Inc and allow them an electronic version of their payroll.");

}

public static double findSalary(int hoursWorked, int ratePay, double overtimeRate) {

double finalSalary= 0;

double overPay = 0;

if(hoursWorked>40)

overPay = overtimeRate * (hoursWorked-40); //calculating the total pay of overtime

if(overPay > 0) //Checking if overpay needs to be added in the final salary

finalSalary = (hoursWorked * ratePay) + overPay;

else

finalSalary = (hoursWorked * ratePay); //else the salary will

return finalSalary;

}

public static void main(String [] args) [

userInstruct();

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

? Help Help Answered: 1 week ago

Answered: 1 week ago

Question

How many Tables Will Base HCMSs typically have? Why?

Answered: 1 week ago

Question

What is the process of normalization?

Answered: 1 week ago