CS 230 Fall 2006 Assignment
4 –More Complicated Branching 100 points
Assigned: 09/27/2006
Due: 10/04/2006 at the start of class
Pre-Lab (Do Before Lab): Bring materials – a way to
save a copy for you and a copy to turn in. Plan out tasks, objects, and events
needed for program. Plan out major pseudocode. This program has complicated
logic – think about it BEFORE lab!!!
Main Assignment:
Write a
program that calculates the amount of tax that a taxpayer should have paid. Get
from the user for their net income (this is income after all deductions and
exemptions etc – we’ll save that stuff for a more advanced program) and the
amount of tax they have already had withheld from their paycheck. Then
according to the simplified (for your benefit) tax schedule shown below,
calculate the amount of tax, and the amount of refund or the amount of tax
still due.
Tax
Schedule (We are only handling Single taxpayers):
Income
|
Tax Rate
|
First $20,000 in net income
|
12%
|
Next $30,000 in net income
|
25%
|
Remaining Income
|
35%
|
Provide
capabilities to calculate, clear the text boxes to start again, and to exit.
Hand in:
- Floppy disk with an entire folder containing all files
related to the project. Please set the name of the project to
something other than the default name (WindowsApplication1, …).
Use Windows to copy the whole folder, instead of trying to “Save As”.
- Print out of your code.
Miscellaneous:
- You must turn
on Option Explicit and Option Strict.
- If you have any
questions about the tax scheme, please ask!!! Read carefully! Your
calculations need to meet the requirements of the task.
- Define income
thresholds and tax rates as named constants, so that if the tax law
changes they are easy to change.
- Note that we have now
covered specifying how many decimal places to display – display a number
appropriate for the results, with currency symbols where appropriate.
- Make outputs “Read Only” so the user cannot change the calculated
results.
- We’re no longer going
to assume that the clerk enters valid and reasonable values, so ensure
that values entered are numbers and that they are in acceptable range.
Let’s assume that income and amount withheld SHOULD NOT be negative, and
that income should not be more than $1 billion and amount withheld should
not be more than $100 million
- MAKE SURE YOUR PROGRAM
WORKS! (i.e. gets the correct answers). Now that our program is branching,
we need to try more examples to make sure they work. Think, “what
different possibilities need to be checked?” For each, calculate the
correct answer by hand and see if your program gets it!
- Put YOUR NAME, and
e-mail address and purpose of the program in comments at the
beginning of the program.
- Put your name on the form as a Label or as part of the form title.
- You MUST include
comments that explain your program in order to get full credit.
- Remember to use
meaningful variable names, and indent to show the structure of the program
(VB usually does this correctly).
- Try to use good user
interface design.