Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Tax Payer Your task is to implement a TaxPayer class with the following attributes: the social security number (use a string for the type), the
Tax Payer Your task is to implement a TaxPayer class with the following attributes: the social security number (use a string for the type), the yearly gross income (double), and the tax owed (double) The tax is 15% of income for incomes under $30000 and 28% for incomes that are $30000 or higher You can start with the following template: public class TaxPayer TODO: Add attributes public TaxPayer TODO Add an overloading constructor that takes two inputsi social security and gross ineone TODO: Add at leaat the three rethods described below Give a TaxPayer Y, the following methods should be defined Y.getGrossIncome ()returns Y's gross income as a double Y.getTaxowedreturns Y's tax owed as a double ? print ( ) prints Y's tax information (see example below) A constructor that takes two parameters: social security number and gross income will be needed to instatiate a TaxPayer object. Then, the tax owed can be computed from these two given inputs. Your implementation should meet the following additional criteria: source file is named as TaxPayer.java income and tax is printed to two decimal places
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