I'm trying to get the following assignment completed but I seem to be stuck.. If I can get help I would appreciate it. This is whats required of the of the program.
I am to write a program that will calculate a person's income tax based upon the following table.
Income -------------------------- Percent Withheld
0 - $10,000 ------------------- 0%
$10,000.01 - $25,000 --------------------- 10%
$25,000.01 - $50,000 -------------------- 20%
> $50,000.01 -------------------- 35%
Than my program should read in the annual salary, calculate the monthly pay, and then remove the income tax. After that print out the yearly salary, gross monthly pay, net monthly pay, and the amount of the monthly withholding.
I have done the input prompts for the annual salary and monthly pay. I seem to be stuck on removing the income tax and how I would go about the printout output for the net pay and monthly withholding.
Here is what I have so far.. I presume I will need to use an if else statement but not sure how to set it up.. any help I'll be sure to return it?
import java.text.DecimalFormat; public class IncomeTaxCalc { public static void main(String[] args) { double salary; double pay; double netPay; salary = GetData.getDouble("Enter yearly salary"); pay = salary / 12.0; netPay = DecimalFormat myNumber = new DecimalFormat("$#,##0.00"); System.out.println("Yearly salary: " + salary + "\n"+"Gross Monthly Pay:" + pay + "\n"+"New Monthly Pay:" + "\n"+"Witholding:" + ); }//end main }//end class