I just started the course and this crazy teacher wants me to do this hard ass question
The government of Mississauga has asked you to write a program that would calculate taxes for Mississauga residents. Your program should ask for the income (income) housing cost (housingCost), number of children (childTotal), and the total number of children in school (schoolChildren). It should then compute and print the tax payable or the refund due. The following are the tax regulations: the municipal tax rate is 19% but residents are not taxed on the first $15000 unless they pay more than $6000 for housing. For every child, residents get a $350 reduction, or $670 if the child is in school. This reduction never results in residents getting refunds unless their housing costs are less than $5800 and they have more than 2 children, at least one of them in school. If the tax payable is more than $1800, then it is increased by an additional 15% surtax.
an output window with the following inputs:
3 children with 1 child in school
35000 income
5999 house cost
this is what i have
// The "Taxesforresidents" class.
public class Taxesforresidents
{
public static void main (String[] args)
{
System.out.println ("Enter the icome");
double income = ReadLib.readDouble ();
System.out.println ("Enter the housing cost");
double housingCost = ReadLib.readInt ();
System.out.println ("Enter the number of children");
int childTotal = ReadLib.readInt ();
System.out.println ("Enter the total number of children in school");
int schoolChildren = ReadLib.readInt ();
if (housingCost <= 600000) income -= 1500000;
if (income < 0) income = 0;
double tax = taxableIncome * 19 / 100;
tax -= 35000 * childTotal;
tax -= (67000-35000) * schoolChildren;
if (tax < 0 && (housingCost > 580000 || childTotal < 3 || schoolChildren == 0)) tax = 0;
if (tax > 180000) tax += income * 15 / 100;
return tax;
}
} // end of main method
} // end of Taxesforresidents class