Java code error!~ Please help
Code:
import java.util.Scanner;
public class IRSTaxes
{
/**
* @param args
* @param taxes
*/
static double taxes;
public static void main(String[] args)
{
// TODO Auto-generated method stub
System.out.println("Enter marital status (1=single, 2=married) ");
Scanner scanner= new Scanner(System.in);
int marital = scanner.nextInt();
System.out.println("Enter taxable income: ");
Scanner scanner1= new Scanner(System.in);
double income=scanner.nextDouble();
if (marital == 1)
System.out.println("Your Federal Tax = $ " + single(income));
}
public static double single(double s)
{
if(s > 0 && s <= 27050);
taxes = (s-27050)*0.15;
if(s > 27050 && s <= 65550);
taxes= (s -65550)*0.275 +4057.50;
if(s > 65550 && s <= 136750);
taxes= (s -136750)*0.305 +14645.00;
if (s > 136750 && s <= 297350);
taxes= (s -297350)*0.355 +36361.00;
if (s > 297350);
taxes= (s -297350)*0.391 + 93374.00;
return taxes;
}
public static double married(double m)
{
if(m>0 && m <=45200);
taxes = (m-45200)*0.15;
if(m>45200 && m<= 109250);
taxes = (m- 109250)*0.275 +6780.00;
if(m>109250 && m<=166500);
taxes = (m- 166500)*0.305 +24393.75;
if(m>166500 && m<=297350);
taxes = (m- 297350)*0.355 +41855.00;
if(m>297350);
taxes = (m- 297350)*0.391 +88306.00;
return taxes;
}
}
when i run the program i get what i want until the federal tax printing. It comes out with a negative number and i cant find out why.