Project 1 FAQ, CISC105 Summer 2005
FAQ
When we calculate the net pay I don't quite understand how to
calculate the different taxes. More specifically, based on what
numbers other than hourly wage do we determine what tax bracket a
person falls under?
Assuming the hourly wage for 40 hours/week for a year, determine the
expected yearly salary. Then, you can determine the tax bracket.
One other thing you ask us to "Calculate the appropriate federal
tax bracket using a switch statement rather than a series of
if-else-if statements." The only way I can think of to do this is to
use an if-else-if statement in main. Is this okay?
One of the quizzes had an example of computing the tax bracket with a
switch statement. You can base your solution on that example.
Since each percentage is being used only once, it seems excessive
to create so many constants, yet constants would allow simpler
changing of values and avoid "magic numbers". I am uncertain as to
where to draw the line, whether size or "no magic numbers" is more
important.
Size is important, but it's not really the size of the program--it's
the size of the program when it executes. Like you said, constants
improve code readability and flexibility. Constants do not
significantly change the amount of space that a program requires.
Next Monday, I'll clarify the different "space" requirements and
tradeoffs to consider.
What do you want for the test plan? Is it a C program?
The test plan is just a plain text file; you can write it in Word, if
you want. The test plan lists the input for your program and the
expected output. The project top sheet has an example test plan,
without the expected output.
You will write up the input and expected results (which you
calculated by hand) for "good" test cases. Then, you will run your
program on these test cases and make sure that your program's actual
results match up with the expected results.
The goal of the test plan is to force everyone to test their
program well so that they'll have near-perfect "correctness" scores.