Yahoo Answers is shutting down on May 4th, 2021 (Eastern Time) and the Yahoo Answers website is now in read-only mode. There will be no changes to other Yahoo properties or services, or your Yahoo account. You can find more information about the Yahoo Answers shutdown and how to download your data on this help page.

I need to create a table for tax and tax bracket according to the details.?

•Your task is to calculate tax amounts from given incomes.

•The tax rates for 2008-2009 (according to the Australian Tax Office) are expressed in the following table. The table also shows how to calculate the tax for a given income.

Income Bracket Tax on this income

$0 – $6,000 0 Nil

$6,001 – $34,000 1 15c for each $1 over $6,000

$34,001 – $80,000 2 $4,200 plus 30c for each $1 over $34,000

$80,001 – $180,000 3 $18,000 plus 40c for each $1 over $80,000

$180,001 and over 4 $58,000 plus 45c for each $1 over $180,000

•The information in the table above can be represented in your program using the following constants. Copy these constants to your source code file.

BRACKET_LIMITS = new Array (

0, // For bracket 0

6000, // 1

34000, // 2

80000, // 3

180000 // 4

);

MIN_TAX = new Array (

0.00, // For bracket 0

0.00, // 1

4200.00, // 2

18000.00, // 3

58000.00 // 4

);

TAX_RATES = new Array (

0.00, // For bracket 0

0.15, // 1

0.30, // 2

0.40, // 3

0.45 // 4

);

PEOPLE = new Array (

'Blackcloud',

'David Lai',

'Richard Watson',

'Leigh Brookshaw',

'Stijn Dekeyser'

);

•The last array above is a list of names.

•Your program will output an HTML table to the document body.

◦The table will have a header row, created using <th> tags.

◦Each row, after the header, will relate to one of the people named in the PEOPLE array.

◦The rows will be output as incomes are input. You should not try to store all the inputs, only the current income for the row.

◦Each row will contain a person's name, their income, eg. $23400, their bracket and the amount of tax in dollars and cents, eg. $3213.43.

•The program will use a loop to gather the incomes and calculate a bracket and tax amount for each of the people in the list of names. The program will output a row to the table each iteration. The number of repetitions should be based on the length of the list rather than a fixed value, so if more names were added or removed from the source code file, the number of iterations would change accordingly when the program is next run.

•The user will be prompted to enter an income amount for each person. The prompt should include the person's name.

•Income is measured in whole dollars only (tax amounts have cents). Inputs will be integers entered by the user. You may assume the user will add a valid integer for each income amount.

•For each income you will first discover an appropriate bracket. Use a multi-way if to find the bracket. Once you have the bracket, the relevant tax figures can be accessed using the bracket as an index into the arrays. You will only need one multi-way if statement (with multiple ifs and an else). There only needs to be a single statement to calculate the tax amount once the bracket is found.

Documentation and formatting

•Your program should be appropriately indented and commented.

•Loops and selection statements should have their bodies indented and enclosed in { curly braces }.

•Within the code, blocks of statements should be commented. Do not comment each statement.

•The JavaScript should be ordered with constants first, then variables, then other statements. Use visual separators.

Hints

•The table will be output by writing the beginning of the table and header row first, outputting rows one at a time in a loop, then outputting the end of the table after the loop.

•When mixing HTML tags and variables/values, you will need to stop the string, then append using +.

•The bracket can be used as an index into the arrays for tax figures. This is how you can achieve a single, generic, tax calculation.

•A good target for the number of variables is three, but more could be used.

2 Answers

Relevance
  • Anonymous
    1 decade ago
    Favorite Answer

    Hello,

    We are here not to do your homework for you, but to help you. Get a start on it and show us what you have and we will be happy to help you if you have any problems.

    -Colin

  • 5 years ago

    80000,00

Still have questions? Get your answers by asking now.