Problem

Every year, loyal Candians fill out their income tax returns and submit them to the federal government. The Canda Revenue Agency (CRA, a branch of the federal government) computes the tax owed and issues either a tax billif the citizen owes taxesor a refund chequeif the citizen has paid too much tax. The country of Canda is divided into 5 provinces: Left Coast, Oilberta, Centrario, Habsland and Franticlantic. The CRA collects provincial taxes as well as the federal taxes and disperses the provincial taxes collected to the individual provincial governments. When a tax return is filed, it includes the citizen's SIN (social insurance number), name, province of residence, total income, total deductions and total tax paid (through installments and/or payroll deduction). The federal government and each province each annually determine a tax schedule which defines how much tax a citizen should pay based on net income (total income minus deductions). A tax schedule has a number of levels. Each level consists of a threshold and a tax rate. The net income up to the lowest threshold has no tax levied; the net income from the lowest threshold to the next threshold has tax levied at the first rate, etc. The net income over the highest threshold is taxed at the highest rate. For example, with the following federal tax schedule:

Threshold Rate
$15,000 15%
$29,000 20%
$50,000 25%

a citizen whose net income is $55,000 would pay:

$15,000*0%+$14,000*15%+$21,000*20%+$5,000*25% = $7,550

in federal tax plus the provincial tax similarly computed from the appropriate provincial tax schedule. When the returns are processed, a report is generated detailing the individual citizen's tax information and the amount owed (for those that owe) or the amount of the refund (for those who have paid too much). After all tax returns have been processed, a report can be generated which shows how much tax the federal government should disperse to each province.

Inputs & Outputs

The tax schedules are available annually as an ASCIIDataFile consisting of 6 schedules (the federal schedule and one for each province). The file contains the number of levels (integer) for the federal schedule followed by, for each level, the threshold (double) and the rate (double). Next, for each province, are the province name (string) and number of levels (integer) in the provincial schedule followed by, for each level, the threshold (double) and the rate (double). This data is used annually to initialize the tax management system.

Taxpayers must file their tax return prior to May 1 of the filing year. When a taxpayer is ready to file, a form such as in Figure 1 is presented. The taxpayer fills in the form and, upon pressing Submit, the tax information is added to the tax records.

Figure 1: Tax Form see image.

After all taxpayers have filed their tax returns (i.e. on or after May 1), the tax filings are processed computing the federal and provincial taxes for each taxpayer. A report is produced listing the tax information of each taxpayer, indicating is the taxpayer owes money (balance shown in Amt Due column) or is due a refund (balance shown in Refund column), as shown in Figure 2.

Figure 2 Tax Information Report see image.

At some time after the tax filings have been processed, a final report can be generated which lists the dispersals of the tax monies collected to each province from the CRA. This report would look line that in Figure 3.

Figure 3 Dispersals Report see image.

Future Considerations

Currently, the returns for all citizens are processed at the same time. In the future, it may be desirable to process batches of returns over a period of time. In this event, the tax information report would be generated for each batch of returns processed, however the dispersals report would be generated only once, after all returns have been processed.

Requirements

1. Perform analysis as discussed in class to get the primary set of classes. Draw the analysis diagram including relationships and multiplicities.

2. Perform design using CRC cards and/or use cases completing responsibilities for knowing, responsibilities for doing and collaborators.

Steps 1 & 2 can be done in groups. There will be an exercise on analysis & top-level design during the tutorial on Mar. 27. Steps 3 through 6 must be individual work.

3. Perform detailed design to develop a complete (and compilable) set of Java interfaces for the identified classes.

4. Perform coding of implementations for the identified classes which may result in discovery of additional support classes.

5. Perform testing of the system.

6. For production (submission), run the system using the supplied data files.

Suggestions

  • The tax schedules work the same way for the federal taxes and the individual provincial taxes.
  • At implementation, consider using separate classes for GUIs and reports.
  • You will likely end up with between 12 and 18 classes and interfaces including classes identified during design, main classes and support classes (e.g. GUIs and reports) identified during coding. There should be interfaces for the classes identified during design, but it is not necessary to have interfaces for support classes (although it doesn't hurt).
  • Marks will be assigned to both the quality of the design and the quality of the implementation.
  • You may want to write a main class to list the tax record information (i.e. tax returns from citizens) for debugging purposes.
  • To make submission easier, you may write the code that a taxpayer uses to enter the tax filing in a loop so more than one filing can be entered in one run.
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.