Consider the following hypothetical income tax filing schedule. This schedule assumes that the individual is eligible to file income tax. There are four filing statuses as shown in the schedule below: single filers, married filing jointly, married filing separately, and head of household. See image.

The amount of taxes that is to be paid by an individual is based on the percentages shown. Any amount of income that is in excess of the range, the excess amount is subjected to be 15%. In addition, if the individual subscribed in excess of the amount of taxes calculated, the individual is due a refund; on the other hand, if the amount subscribed is inadequate, then the individual has to pay the shortfall and a 5% penalty of the shortfall.

For example, if an individual who single with a taxable income of $10,000, the first $8,350 is taxed at 10% and the other $1,650 is taxed at 15%. So, the total tax is $1,082.5. If the person had subscribed $1,500.00 for the year, that individual would get a refund of $ 417.50; however, if the individual subscribed only $900.00, then the individual would have to pay $182.50, plus a 5% penalty on this amount.

Write a class called IncomeTax that accepts the following:

  • The name of the principal wage earner
  • A single character denoting the following: s – single filer, j – married filing jointly, s – married filing separately, and h – head of household.
  • The amount in wages earned over the year
  • The amount of tax paid during that year.

Among other things, design a mutator method to calculate to carry out the required calculations. Also, use the switch statement to determine the type of filer – single filer, married filing jointly, married filing separately, or head of household.

Design your own test class, and fashion the output according to your liking, but must include all relevant information.

Use the class GetData for inputting the data. You will have to code a method that can be used to return a single character.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.