Question
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
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%
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.
d. (1.5 points) Write the information as a comma separated text into a text file. The structure of the text is illustrated below
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started