Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 2 (5 points) a. (1 points) Create a TaxReturn class with fields that hold a taxpayers information as follows Social Security number, last name,

Question 2 (5 points) a. (1 points) Create a TaxReturn class with fields that hold a taxpayers information as

follows

Social Security number, last name, state, annual income,

marital status,

b. (1 points) Include a method computeLiability() that computes tax liability based on the table below and returns the tax liability amount

image text in transcribed image text in transcribed image text in transcribed image text in transcribed image text in transcribed image text in transcribed image text in transcribed

Income 0-20,000 20,001-50,000 50,001-70,000 70,001 and above

Marital Status Single Married 10% 8% 15% 12% 21% 18% 28% 25%

image text in transcribed image text in transcribed image text in transcribed image text in transcribed image text in transcribed image text in transcribed image text in transcribed image text in transcribed image text in transcribed image text in transcribed image text in transcribedimage text in transcribed image text in transcribed image text in transcribed image text in transcribed

Save the file as TaxReturn.java.

c. (1.5 points) Create another application and save it as PrepareTax.java. In the main method of this application do the following. Create an instance of the TaxReturn class you created. Prompt the user 5 times for the data needed to create a TaxReturn object(As illustrated below)

After collecting all the input data, use the information entered by the user to instantiate the object properties of the TaxReturn object you created. Then compute the tax liability. Then display the information on the console as illustrated below Additionally store the information in a text file. Name the file taxFile.txt.

image text in transcribed

image text in transcribed image text in transcribed image text in transcribedimage text in transcribed image text in transcribed

d. (1.5 points) Write the information as a comma separated text into a text file. The structure of the text is illustrated below

image text in transcribed

Tax Info Enter your last name Gates OK Cancel Tax Info Are you Married \begin{tabular}{|c|c|c|c|} \hline Tax Info & & & \\ \hline? & \multicolumn{3}{|c|}{ Enter your yearly income } \\ \hline & \multicolumn{2}{|l|}{32000} & \\ \hline & OK & Cancel & \\ \hline \end{tabular} \begin{tabular}{|ll|} \hline Tax Info & \\ ? & Enter your SSN \\ \hline & 6587856235 \\ & OK Cancel \\ \hline \end{tabular} 658785235, Gates, Arkansas, Married, 32000, 3840| Tax Returns SSN : 658785235 Last Name :Gates State: Arkansas Marital Status :Married Annual Income: $32,000.00 Tax Liability : $3,840.00 \begin{tabular}{|c|c|c|c|} \hline Tax Info & & & \\ \hline? & \multicolumn{3}{|l|}{ Enter State } \\ \hline & \multicolumn{3}{|l|}{ Arkansas } \\ \hline & OK & Cancel & \\ \hline \end{tabular} Tax Info Enter your last name Gates OK Cancel Tax Info Are you Married \begin{tabular}{|c|c|c|c|} \hline Tax Info & & & \\ \hline? & \multicolumn{3}{|c|}{ Enter your yearly income } \\ \hline & \multicolumn{2}{|l|}{32000} & \\ \hline & OK & Cancel & \\ \hline \end{tabular} \begin{tabular}{|ll|} \hline Tax Info & \\ ? & Enter your SSN \\ \hline & 6587856235 \\ & OK Cancel \\ \hline \end{tabular} 658785235, Gates, Arkansas, Married, 32000, 3840| Tax Returns SSN : 658785235 Last Name :Gates State: Arkansas Marital Status :Married Annual Income: $32,000.00 Tax Liability : $3,840.00 \begin{tabular}{|c|c|c|c|} \hline Tax Info & & & \\ \hline? & \multicolumn{3}{|l|}{ Enter State } \\ \hline & \multicolumn{3}{|l|}{ Arkansas } \\ \hline & OK & Cancel & \\ \hline \end{tabular}

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

Wildlife Ecology Conservation And Management

Authors: John M. Fryxell, Anthony R. E. Sinclair, Graeme Caughley

3rd Edition

1118291077, 978-1118291078

More Books

Students also viewed these General Management questions

Question

Who holds the power in recruitment and selection?

Answered: 1 week ago

Question

Explain the effectiveness of various selection methods

Answered: 1 week ago

Question

Explain the nature of attraction in recruitment

Answered: 1 week ago