Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program for computing taxes using arrays. Design a class named Tax to contain the following instance data fields: int filingStatus: One of the

Write a program for computing taxes using arrays. Design a class named

Tax

to contain the

following instance data fields:

int filingStatus: One of the four tax-filing statuses: 0single filer, 1married filing jointly

or qualifying widow(er), 2married filing separately, and 3head of household. Use the

public static

constants SINGLE_FILER (0), MARRIED_JOINTLY_OR_QUALIFYING_WIDOW(ER)

(1), MARRIED_SEPARATELY (2), HEAD_OF_HOUSEHOLD (3) to represent the

statuses.

int[ ][ ] brackets: Stores the tax brackets for each filing status.

double[ ] rates: Stores the tax rates for each bracket.

double taxableIncome: Stores the taxable income.

Provide the getter and setter methods for each data field and the getTax( ) method that returns the

tax. Also, provide a default constructor and the constructor

Tax(filingStatus, brackets, rates, taxableIncome).

Write a test program that uses the Tax class to print the 2001 and 2009 tax tables for taxable

income from $50,000 to $60,000 with intervals of $1,000 for all four statuses.

It has to written in Java, and it would be appreciated if the concept is simple and short.

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

Database Concepts

Authors: David Kroenke, David J. Auer

3rd Edition

0131986252, 978-0131986251

More Books

Students also viewed these Databases questions

Question

What is rewarded? Who is valued?

Answered: 1 week ago

Question

What is topology? Explain with examples

Answered: 1 week ago

Question

What is linear transformation? Define with example

Answered: 1 week ago