Question: Java Create a TaxPay class with fields that hold a taxpayers Social Security number, last name, first name, street address, city, state, zip code, annual
Java
Create a TaxPay class with fields that hold a taxpayers Social Security number, last name, first name, street address, city, state, zip code, annual income, tax. Include a constructor that requires arguments that provide values for all the fields except tax. The constructor calculates the tax liability based on annual income and the percentages in the following table. Include a display method that displays all the information data. Save the file as TaxPay.java. Annual Income ($) Tax Rate (%) 0-41725 5.06 41725.01-83451 7.70 83451.01-95812 10.50 95812.01-116344 12.29 116344.01-157748 14.70 157748.01-220000 16.80 220000-More 20.50 Create an application that prompts a user for the data needed to create a TaxPay for a resident. 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 six digits with format A9A9B9. The annual income is negative. After all the input data is correct, create a TaxPay object and then display its values. Save the file as TaxMain.java.
output


Console X TaxMain [Java Application] C:\Program Files\Java Enter Social Security number 123-11111111 Enter Social Security number 2 Console X TaxMain [Java Application] C:\Program Files Enter Social Security number 111-11-1111 Enter Annual Income 34000 Enter Zip Code D4D555 Enter Social Security number e Console X
Step by Step Solution
There are 3 Steps involved in it
To create this Java program you need to define two classes TaxPay and TaxMain Below Ill provid... View full answer
Get step-by-step solutions from verified subject matter experts
