Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Specifics: Create a TaxReturn class with fields that hold a taxpayers Social Security number, last name, first name, street address, city, state, zip code, annual

Specifics:

Create a TaxReturn class with fields that hold a taxpayers Social Security number, last name, first name, street address, city, state, zip code, annual income, marital status, and tax liability. Include a constructor that requires arguments that provide values for all the fields other than the tax liability. The constructor calculates the tax liability based on annual income and the percentages in the following table.

Marital Status

Income ($)

Single

Married

0-20,000

15%

14%

20,000-50,000

22%

20%

50,000 and over

30%

28%

In the TaxReturn class, also include a display method that displays all the TaxReturn data. Save the file as TaxReturn.java. Create an application that prompts a user for the data needed to create a TaxReturn. Continue to prompt the user for data as long as any of the following are true:

The Social Security number is not in the correct format, with digits and dashes in the appropriate positions; for example, 999-99-9999.

The zip code is not five digits.

The marital status does not begin with one of the following: S, s, M, or m.

The annual income is negative.

After all the input data is correct, create a TaxReturn object and then display its values. Save the file as PrepareTax.java.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Database 11g SQL

Authors: Jason Price

1st Edition

0071498508, 978-0071498500

More Books

Students also viewed these Databases questions

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago