| Due Time/Date: | Wednesday November 17th, 2004 12:00 midnight uhunix time. |
| What to do | Create a JAVA program that will be called Taxes.java Failure to name the program and methods as requested will result in a 10 point deduction per mistake. |
|
How to turn in your homework? |
|
This assignment requires you to read the taxpayer information and given this and a tax
table you will calculate the taxes that this person needs to pay.
Please keep in mind that this is a hypothetical situation. We are trying to make this
simple.
Taxes.java technical details:
When your program begins it will display the following menu:
TAXESThe menu options should loop until the user chooses to exit (option 0).
Each menu option should be taken care of in a separate method. The development of extra methods is
encouraged. Be smart, plan ahead by pseudocoding and recycle your code by using
more short and task-oriented methods.
method: fileProcessing( ) must be boolean and it will process tax information
from a
file. If the input file is not found you should return false. If all goes well you will
return true. This method will take no parameters. All the file processing should either
be done in this method or in other methods that you may want to create.
method: clientProcessing( ) this is a void method. It will process one client's tax
information. If there are any errors in the information entered by the user they should
be dealt with inside the method itself. You should read from the keyboard and process
the information inside the method itself. This method will not return anything. The
results of the client tax process should be printed in this method as well.
method: printTable( ) this is a void method. It is just a bundle of println
statements
that will display the tables used to calculate tax payments/refunds.
Option 1 - Process tax information from a file
Format of Input file entries are as follows:
NAME : INCOME : DEPENDANTS
There should be one taxpayer per line.
Each field should be separated from the others by colon (:).
Option 2 - Process one client's tax information
Option 3 - Print tax tables in use
You will display the following information (obviously not in table format but in plain
text). Format this information and print it to the screen. Hint: a bunch of
System.out.println statements will do the trick
| income |
formula |
| less than $10,000 | a fixed $50 tax |
| $10,000 <= income <=$40,000 | tax will be 23% of the income |
| $40,000<income<=$99,000 | tax will be 30% of the income |
| $99,000<income<=$500,000 | tax will be 35% of the income |
| over $500,000 | tax will be 39% of the income |
| dependants |
credit |
| 0 | no credit |
| 1 - 4 | $40 per dependant |
| 5 - 6 | $45 per dependant |
| more than 6 | $50 per dependant |
Rules for the input and output files:
Format of Input file entries are as follows:
NAME : INCOME : DEPENDANTS
There should be one taxpayer per line.
Each field should be separated from the others by colon (:).
Format of Output file entries are as follows:
NAME : INCOME : DEPENDANTS : TAX-TO-PAY
There should be one taxpayer per line.
Each field should be separated from the others by colon (:).
The screen output should look as follows:
Name: Taxpayers Name Income: $99,999 Dependants: 9 Tax to pay: $99,999 (refund/payment due)Notice that "9" is used to symbolize number.