...the income-tax taxable-income problem is a bit sketchy. If we are not to use conditional statements at all then how are we supposed to decide if we are to keep adding more tax for higher income.
You are thinking procedurally instead of functionally when you say "keep adding more tax".
You must write an expression that computes the value to be returned. Perhaps it is simplest to break down the problem into smaller parts --- come up with a simple expression that computes the value you must return in terms of other values. Then how would you compute those values based on the information (i.e. arguments and constants) that you have?
...on the pascal triangle program are we supposed to assume that the triangle is there in a list to begin with or are we supposed to create a pascal triangle up to the column and row specified and then return a value.
The problem says that your solution must be recursive. Your procedure should also work for any valid inputs (here for integral c and r such that 0 <= c <= r).
Question 3 says to only use "procedures from this section". Does this mean that we can use "list", "append" and "cons" or are we limited to the procedures introduced after those ("car", "cdr", etc.)? I ask since the previous question allowed only "list", "append" and "cons".For question 3 (Exercise 1 from Section 9.4 of HtSPUS), use any of the procedures from section 9. In fact, you can't do some of these problems without procedures from the first subsection of section 9.
Bracket | Amount in bracket | Tax |
---|---|---|
15% | $20,000 | $ 3,000.00 |
total | $20,000 | $ 3,000.00 |
Bracket | Amount in bracket | Tax |
---|---|---|
15% | $26,250 | $3,937.50 |
28% | $63,550 - $26,250 = $37,300 | $10,444.00 |
30% | $120,000 - $63,550 = $56,450 | $ 16,935.00 |
total | $120,000 | $31,316.50 |
Bracket | Amount in bracket | Tax |
---|---|---|
15% | $26,250 | $3,937.50 |
28% | $63,550 - $26,250 = $37,300 | $10,444.00 |
30% | $132,600 - $63,550 = $69,050 | $20,715.00 |
36% | $288,350 - $132,600 = $155,750 | $56,070.00 |
39.6% | $500,000 - $288,350 = $211,650 | $83,813.40 |
total | $500,000 | $174,979.90 |
You don't need to worry about dollar signs, commas, and periods. (In fact, I haven't yet told you how to print anything from Scheme programs!) I simply used them above for clarity. Just compute the number of dollars of tax owed on the given income. You can assume that the taxable income is nonnegative.
Before everyone starts fleeing the country, I should add that "taxable income" is your total income, less deductions, exemptions, etc.