Question: Write a complete Java program called ''IncomeTax'' (without the quotation marks) that prompts a user for his or her marital status (single or married) and

Write a complete Java program called ''IncomeTax'' (without the quotation marks) that prompts a user for his or her marital status (single or married) and annual income (a double value), and then uses nested if statements to compute that person's tax, based on the simplified tax-rate table below.

Simplified Tax-Rate Table
Income

Marital Status - Single

Marital Status - Married

<= $30,000

25%

20%

> $30,000

15%

12%

Your program must be written so that it

uses nested if statements

prints the dollar sign, and prints the numbers to two decimal places

uses constants for the tax rates

has just one print statement for the output (you'll also need print statements for the prompts)

has prompts that tell the user exactly how to input the requested information.

prints as output: "Based on a marital status of X and a tax rate of Y, your tax is Z", where X is the marital status the user entered, Y is the appropriate tax rate for the entered income and marital status, and Z is the amount of tax printed to two decimal places.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!