(Latest Revision: 10/05/2004)
SECOND CS 1500 SOLO PROGRAM: Estimating
Federal Income Tax
Your assignment is to write a program that estimates 2003 federal income
tax.
INPUT AND OUTPUT:
The program must prompt first for filing status. The user will enter S, H,
J, or M in response to this prompt. Next the program must prompt for the
taxable income. The user will input a non-negative integer taxable income.
The program will compute the estimated tax on the taxable income, using
this information.
(There is a low-quality reproduction
here.)
The program will use Schedule X, Y-1, Y-2 or Z according to which letter the
user has input. The program will then report the tax, as an integer. (This
means the program cannot report cents, and so it is permissable if the
reported value is incorrect by up to one dollar more or less than the true
amount.) Give some thought to how the output should look and give it a clear,
easy-to-understand format.
Have a look at
the sample script
to see how it should look when you run the program. Make sure to write the
program so that it inputs only the filing status and taxable income.
If I decide I want to test all the programs I will want to use redirection
from prepared files of input. This requires that you and I have a precise
agreement on the form of the input.
FORM, STYLE, AND CORRECTNESS:
Your program must conform to the rules below. We will discuss and clarify
the meaning of these rules in class.
- Including the main function, there must be at least four functions.
More than four functions would be better. Look
here
for a nice design structure which calls for a total of nine functions.
- There must be no "global variables" -- every variable in the program
must be declared inside the body of one of the functions.
- When a function F calls another function G, all communication between F
and G must be done with parameters and return values.
- Every function must have a header comment that states what the function
does (its purpose).
- The test script must show testing of a representative sample of
ordinary data. It must also show coverage on and near at least two
boundary data values.
- If I run your program and it gives an incorrect result, then you may
lose a very substantial amount of the credit for this assignment. (How
tolerant would you be of a tax program that gives wrong answers?)
Before midnight on the due date, e-mail the following two items to
me:
- A copy of the source code, properly documented.
- A filtered script showing a test run.
My e-mail address is:
john@ishi.csustan.edu
Please use the following subject lines exactly
for the e-mails:
For the source file: CS1500,Solo2,source
and for the script file: CS1500,Solo2,script
Note that there are no spaces in these subject lines. If you like, you can
copy and paste the subject lines right from this document.
Thanks! Your use of these subject lines will really be a big
help to me when I try to sort through the perhaps hundred e-mail messages
that will be in my electronic mailbox!
WHEN IS THIS ASSIGNMENT DUE?
Look for the due date in
the class schedule
.