Question: The pictures are in the wrong order. Please code this as simple as you can!! Insert code at the end of the program so that


The pictures are in the wrong order. Please code this as simple as you can!!
Insert code at the end of the program so that it computes and displays the provincial tax and finally the total tax using the rules shown below: The base provincial tax will be: 42.5% of the federal tax The deductions for the provincial tax will be: $160.50 + $328 per dependent The provTax is then calculated as $0 if the base provincial tax is less than the deductions, otherwise as follows: base - deductions The total tax is the sum of the fedTax and the provTax. Test your code with the following values to make sure that it is correct: Income $25,000 $53,000 $65,000 Dependants FedTax $4,250 $11,116.90 $14,411.50 Prov Tax $1,317.75 $3,908.18 $4,980.39 TotalTax $5,567.75 $15,025.08 $19,391.89 Adjust your code above so that it displays with the following output format by using System.out.println() statements as well as String.format() (see Chapter 1 of Mark Lanthier's notes for details on String.format()): Please enter your taxable income: 25000 Please enter your number of dependents: 1 Here is your tax breakdown: Income Dependants $25,000.00 1 Federal Tax Provincial Tax $4,250.00 $1,317.75 Total Tax $5,567.75 Problem 2 (Tax Program) Within the same project, create a class called TaxProgram with the code shown below. It should compile and run. Currently, the program just asks the user for their taxable income and then the number of dependents that they have. import java.util.Scanner; public class TaxProgram public static void main(String args[]) { double income, fedTax, provTax; int dependents; Scanner input = new Scanner(System.in); System.out.print("Please enter your taxable income: "); income = input.nextDouble(); System.out.println(); System.out.print("Please enter your number of dependents: "); dependents = input.nextInt(); System.out.println(); fedTax = 0.0; provTax = 0.0; // Add code here Making use of the income and fedTax variables in the code, insert code at the end of the program so that it computes and displays the fedTax using the rules shown below: If the income is less than or equal to $29,590, the federal tax should be 17% of the income . If the income is in the range from $29,590.01 to $59,179.99 then the federal tax should be: (17% of $29,590 + (26% of (the income minus $29,590)) . If the income is $59,180 or more then the federal tax should be: (17% of $29,590) + (26% of $29,590) + (29% of (the income minus $59,180)) Test your code with the following values to make sure that it is correct before you continue: Income FedTax $25,000 $4,250 $53,000 $11,116.90 $65,000 $14,411.50 9
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
