I have tried all I know and still continue to get errors in my program can any one give me some guidance? I would be grateful. What I wrote is:
import java.text.*;// For using DecimalFormat class for 2 decimal places
import java.util.*;// For using Scanner class for input
public class Tax
{
public static void main(String [] args)
{
Scanner key = new Scanner(System.in);
DecimalFormat twoDec = new DecimalFormat("$0.00");
Taxable income = 0.0, Tax payable = 0.0;
System.out.print("Enter Taxable income ($): \t");
Taxable income = Key.nextDouble();
if (Taxable income < 1.00)
{
System.out.print("Error: Taxable income cannot be less than 1.00");
}
else
{
if (Taxable income <= 4461.99)
{
Tax payable = 0.00 * 4461.99;
}
else if (Taxable income <= 17893.99)
{
Tax payable = 0.30 * 17894.00;
}
else if (Taxable income <= 29499.99)
{
Tax payable = 4119.00 && 0.35 * 17894.00;
}
else if (Taxable income <= 45787.99)
{
Tax payable = 8656.00 && 0.46 * 29500.00;
}
else
{
Tax payable = 11179.00 && 0.60 * 45788.00
}
System.out.println("Enter Taxable income:");
System.out.println("0.99");
System.out.println("Taxable income:0.99");
System.out.println("Error: Taxable income cannot be less than 1.00");
}
}
The errors I get is:
';' expected
not a statement
'else' without 'if'
illegal start of type
<identifier> expected
class, interface, or enum expected