Question: Write a Java program to print a person's tax information, calculating the amount of state tax based on the state. The program should ask the

Write a Java program to print a person's tax information, calculating the amount of state tax based on the state. The program should ask the user for the state code (either PA or UT) and annual income amount. Use a decision structure to determine which state was entered. Based on which state was entered, call the appropriate value-returning method (pg 294) to calculate and return the tax. If the state is UT, ask the user for the marital status in the decision structure so it can be passed to the UT tax method. Then, write a value-returning method to get the state name. Finally, write a void method (pg 271) to print the results. The only statements in your decision structure are to get the marital status for UT, and to calculate the state tax by calling the appropriate state tax methods. Thus, you will call the state tax method to get the tax amount. Everything else is outside the decision structure. Write a value-returning method to find the state name using the state code entered by the user. Write a void method to print the results, sending the state code, state name, salary, and state tax amount. The annual salary and state tax should be printed with a dollar sign, commas, and two digits to the right of the decimal. You can use Scanner or JOptionPane.
Pennsylvania (PA) Tax Method: This value-returning method (pg 294) should accept the annual income amount, then calculate the tax. Calculate the tax as the taxable amount *3.07%.
Utah (UT) Tax Method: This value-returning method (pg 294) should accept the marital status and the annual income. First, calculate the tax amount as annual income *4.95%. Then, subtract $360 if the marital status is Single or subtract $720 if the marital status is Married. If the result is negative, then return a tax of 0.00; otherwise, return the calculated amount.
State Name Method: This value-returning method (pg 294) should accept the state code (2-character) and return the state name. PA = Pennsylvania, UT = Utah, LA = Louisiana (optional).

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 Programming Questions!