Re: Please help!



dharajsmith@xxxxxxxxx wrote:
) Here is the assignment:
)
) You are an accountant setting up a payroll system for a small firm.
) Each line of the table in Appendix G (posted below) indicates an
) employee's salary range and corresponding base tax amount and tax
) percentage. Given a salary amount, the tax is calculated by adding the
) base tax for that salary range and the product of percentage of excess
) and the amount of salary over the minimum salary for that range.
) · Design a program that solves this problem.
) · Generate a set of input test values.
) · Perform a design walkthrough to verify your design.
)
) Appendix G:
)
) Sequential and Selection Process Control Structure
) In the following example, the second line of the table specifies that
) tax due on a salary of $2000.00 is $225.00 plus 16% of excess salary
) over $1500.00 (that is, 16% of $500.00). Therefore, the total tax is
) $225.00 + $80.00, or $305.00.
)
) Salary Range in Dollars Base Tax in Dollars Percentage of Excess
) 1 0.00-1,499.99 0.00 15 %
) 2 1,500.00-2,999.99 225.00 16 %
) 3 3,000.00-4,999.99 465.00 18 %
) 4 5,000.00-7,999.99 825.00 20 %
) 5 8,000.00-14,999.99 1425.00 25 %

You could do it in SQL, by the way. Put the above figures in a table,
put the salaries in another table, and then you can calculate the result
with a single SELECT statement.

Something like:
SELECT s.salary, t.base + ((s.salary - t.min_range) * t.tax) AS tax
FROM tax_table t, salary_table s
WHERE s.salary >= t.min_range
AND s.salary <= t.max_range

As you can see, picking the right language/tool makes the solution a lot
easier.
(Even though your instructor will probably not accept this, what with it
being a programming course, and SQL only barely qualifying as a programming
language...)


SaSW, Willem
--
Disclaimer: I am in no way responsible for any of the statements
made in the above text. For all I know I might be
drugged or something..
No I'm not paranoid. You all think I'm paranoid, don't you !
#EOT
.



Relevant Pages

  • Re: software thuriam
    ... And your programming question for this group is what? ... design personalized software for any particular business functions. ... · Database design & development tasks include Website Design / ...
    (microsoft.public.vb.general.discussion)
  • Re: Please help!
    ... Given a salary amount, the tax is calculated by adding the ... base tax for that salary range and the product of percentage of excess ... · Design a program that solves this problem. ... Perform a design walkthrough to verify your design. ...
    (comp.programming)
  • Re: notifier verifire softwarw
    ... The Edwards FireShield panels were designed to allow programming from the panel without software. ... I know because I was involved in the design discussions while my company was wrting the ... Sarasota · Florida · 34233 ...
    (alt.security.alarms)