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 valuereturning method pg 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 valuereturning method to get the state name. Finally, write a void method pg 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 valuereturning 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 valuereturning method pg should accept the annual income amount, then calculate the tax. Calculate the tax as the taxable amount
Utah UT Tax Method: This valuereturning method pg should accept the marital status and the annual income. First, calculate the tax amount as annual income Then, subtract $ if the marital status is Single or subtract $ if the marital status is Married. If the result is negative, then return a tax of ; otherwise, return the calculated amount.
State Name Method: This valuereturning method pg should accept the state code 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
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
