Your first task is to write an if-else statement to calculate the tax correctly. If the income is less than (or equal to) the tax-free threshold then the tax will be zero. But any income above that tax-free threshold will be taxed at the rate of 30%.
Example: if I earn $20000, this is above the threshold of $18200, so the portion of my income that is above the threshold is $20000 – $18200 = $1800, and that portion is taxed at 30% ($1800 * 0.3 = $540).
Run the program several times with different ‘income’ amounts to test that your program is working correctly then fill in column two (Proposed Tax) of the following table, using a tax-free threshold of $18,200.
#Sales Offer!| Get upto 25% Off: