|
|
|
This program will get a double value from the
user the use it to calculate the user's federal income tax. I hope this little program is helpful to those who download it.
//Name of Program File: IncomeTaxCalculation
//Author: Travis McGrath
//INFO140 Section # 04 Date: Oct. 13, 2001
//Your Company Name: Myself
//Description: This program will get a double value from the user the use it
// to calculate the user's federal income tax.
public class IncomeTaxCalculation
{
public static void main (String[]args)
{
//declare variable
double federalIncomeTax;
double taxableIncome;
//explain program to user
System.out.print("This program will calculate your basic amount of" +
" federal income tax as a canadian taxpayer");
//get taxable income from user
System.out.println();
System.out.print("Please enter the amount of your taxable income: ");
taxableIncome = MyInput.readDouble();
System.out.println();
if (taxableIncome <= 30004)
{
federalIncomeTax = 0.17 * taxableIncome;
System.out.println("The amount of your Federal Income Tax is " + federalIncomeTax);
}
if ((taxableIncome > 30004) && (taxableIncome <= 60009))
{
federalIncomeTax = 0.25 * (taxableIncome - 30004) + 5101;
System.out.println("The amount of your Federal Income Tax is " + federalIncomeTax);
}
if (taxableIncome > 60009)
{
federalIncomeTax = 0.29 * (taxableIncome - 60009) + 12602;
System.out.println("The amount of your Federal Income Tax is " + federalIncomeTax);
}
}//end of main
}//end of class
|