COSC 117

Project 1

 

Brief Description

 

Your boss wants you to write a program to calculate federal taxes on a list containing various incomes.  The program will read the values from the keyboard with -1 as sentinel data to end the list.  The program will calculate the appropriate tax for each amount and keep a running total of all taxes.  It will display the tax for each income level and at the end (when the -1 value is given) it will display the sum total of all the taxes generated from the list.

 

The following is a list of tax brackets to be used:

 

$   0.00   to $ 15,000              10% federal tax

$ 15,001 to $ 60,000              15 % federal tax

Over $60,000                         33% federal tax  (Note:  There are actually  six  tax brackets but we use only  3  here to make the problem easier.  The real tax brackets are found at the end of this  assignment.)

 

But there is a catch.  A person in the 15,001 to 60,000 bracket pays only 10% on the first 15,000 and 15% on the remaining income.  A person in the over 60000 bracket pays only 10% on the first 15,000 and 15% on the next 45,000 (the amount in the second bracket) and 33% on the remaining income. 

 

Sample Input/Output

Sample I/O 1

Please input the income, type -1 to end

12000

The tax on $12000.00 is $1200.00      (first bracket so .10 * 12000)

Please input the income, type -1 to end

128760                (third bracket so 15000 (largest tax on 1st bracket) + 6750

The tax on $128760.00 is $30940.80     ( largest tax on 2nd bracket + amount

Please input the income, type -1 to end( over 60000 * .33)

-1

The total tax is $32140.80

Sample I/O 2

Please input the income, type -1 to end

14500

The tax on $14500.00 is $1450.00

Please input the income, type -1 to end

56700

The tax on $56700.00 is $7755.00

Please input the income, type -1 to end

256090

The tax on $256090.00 is $72959.70

Please input the income, type -1 to end

-1

The total tax is $82164.70

This project will consist of 2 parts:

<> 
1)   
An algorithm in Java which identifies the noun and noun phrases for the variables and a list of verb and verb phrases for the instructions.  These will then be used to create pseudo code (an algorithm)
2)    
The Java code  You must use only constatns (no literal values) in the Java code <>       You must name the class IncomeTax
3)     A textual storyboard for the problem in Alice. 
4)    
The Alice code for the problem.  The Alice program will only have to calculate the tax on one income.  It will not use a loop. 

 

The Alice story storyboard should include a scene.  It can be any scene you like with at least one person or animal or fish etc. that will ask the user for the income and calculate and print to the screen the tax. 

Sample Input/Output for Alice

Herbert says:  Hi we are going to calculate federal tax given an income.  You will be asked to type an income and I will calculate your federal tax.

Please input the income      56700

The tax is $7755.00

 

The Java portion of this project is worth 65%

The Alice portion of this project is worth 35%

Extra Credit:

Do the Java for six tax brackets as given in footnote 1.         7 extra points

Do Alice for multiple incomes                                               5   extra points.


The actual six tax brackets are:

0-           15,000     10%                           60,001 -120,000  25%                          180,001  326,000    33%

15,001- 60,000     15%                         121,000-180,000  28%                           326,001  above        35%-