Explore BrainMass
Share

# Tax Time: Java Program

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

You have been asked by a tax return preparer to create a program which will help him calculate taxes. This preparer will at most have 100 clients. For each client, he has to keep track of the client's first name, last name, gross income, and number of children. Use parallel arrays to store this information for him.
A taxpayer's federal tax due is calculated as follow. First, the taxpayer gets a dependency exemption deduction of \$2,000 for each child. So, if a taxpayer has two children, he or she will get a dependency exemption deduction of \$4,000. A taxpayer gross income is reduced by the amount of the dependency exemption deduction to determine his taxable income.

The amount of tax due is a percentage of taxable income. If taxable income is greater than or equal to \$100,000, the tax due is 30% of taxable income. If taxable income is greater than or equal to \$50,000, but less than \$100,000, the tax due is 20% of taxable income. If taxable income is less than \$50,000, tax due is 10% of taxable income. A taxpayer cannot have a negative tax due - if his taxable income is less than 0, his tax due Is 0.

Present the user with a menu of the following four choices
1. Add taxpayer info (This will allow the user to enter the info (first name, last
name, gross income, number of children for ONE taxpayer )
2. View info for all taxpayers (This will allow the user to view info for all taxpayers: first and last name, gross income, number of children, tax due.)
3. Find and display the total owed for all taxpayers
4. Exit the program (If the user choices 4, the program will exit. If the user chooses 1, 2 or 3, the program will do what the menu item says it will do, and then the menu will appear again.

- Design Documents: an IPO (Hierarchy Chart) and either a detailed flowchart or pseudo code.
- Create a Solution in a .java file

https://brainmass.com/computer-science/pseudocode/tax-time-java-program-523102

#### Solution Preview

There are two parts to this solution. The design is shown using an IPO chart and a flowchart. The IPO chart shows a natural breakdown of the tasks that are needed to solve the problem. It shows a hierarchical breakdown as well. For example, in order to do do the entire problem you need to "Get User Input" then "Process Request".
In ...

#### Solution Summary

This solution shows the basics of creating a Java class. It also shows an example IPO and Flowchart used to design a Java program.

\$2.19

## Understanding how to declare and use variables in computer science homework.

How do you figure out how to declare a variable? How do you know what type of variable to use? What is the best way to name a variable and why? What are the differences between an integer variable and a floating point variable? When and why do data type conversions occur? What is the modulus operator?

Write a short java statement for each question item

1) Declare a variable for each of the data types, pay attention to the naming convention and syntax

a. a int variable representing the number of students, the value of this variable is 45.

b. a double variable representing a student' s GPA.

c. a float variable representing the amount you need to pay for gas at a gas station.

d. a char variable that has the value of C.

e. a String variable containing the name of your pet/hometown/your favorite dish.

2) Write down the result for the following statement.

a. inta=15; float b = 15.0; ?c = a + b;?Question: the data type of c should be ___30___

b. inta=5;?double b = 15.0;?c = a + b;?Question: the value of c is ___20___, the data type of c is ___double____

c. int numOfPeople = 10;?int numOfApple = 4;?c = numOfPeople / numOfApple;?Question: the value of c is __2.5_____, the data type of c should be _______

d. int numOfPeople = 10;?int numOfApple = 4;?c = numOfPeople % numOfApple;?Question: the value of c is _______, the data type of c should be _______

e. int numOfPeople =10;?int numOfApple = 4;?double applePerPerson = 0.0;?applePerPerson = numOfPeople / numOfApple; Question: the value of applePerPerson is ______.

f. int num1 = 5; int num2 = 4; ?int result = num1 % numb2;?Question: the value of result is __________.

g. Let assume you have 1003 cents, using / and % to write a block of java statement to calculate the number of dollars, quarters, and cents you have.
Section Three

Write a block of pseudo code that captures the following federal tax bracket, please note that the following chart is an approximation of the tax bracket, but is not the actual tax bracket:

For people who file single status, Taxable income
0 - \$8,500 \$8500-\$34,500 \$34,500 - \$83,600 \$83,600 - \$174,400 \$174,400 - \$379,150
\$379,150 above
tax bracket 10%?15%?25%
28% 33%
35%

View Full Posting Details