(Latest Revision: 09/27/2013)

SECOND CS 1500 SOLO PROGRAM: Estimating California Income Tax

Your assignment is to write a program that estimates 2013 state income tax for single filing status.

INPUT AND OUTPUT:

The program must prompt for the taxable income. The user will input a non-negative taxable income.

The program must compute the estimated tax on the taxable income, using this version of Schedule X.

The program must then report the tax, formatted as a fixed-point decimal with (exactly) two digits after the decimal point.

(Refer to the example on page 41 of your text, and the discussion on page 44, which illustrates the use of a double data type to represent a number 'that has a fractional part,' and the explanation on pages 55-56 of how to format output of values of type double.)

Have a look at the sample runs to see how things must look when you run the program.

Make sure to write the program so that it inputs only the taxable income. When I test the programs of all the students in the class, I will need to use special techniques (a script that utilizes redirection from prepared files of input). In effect, another program will test your program, and the programs of all your classmates. This requires that all the programs behave exactly the same way, especially when they read input.

PITFALLS:

Commas have a special meaning in C++. NEVER USE COMMAS IN A C++ PROGRAM TO SEPARATE GROUPS OF DIGITS IN NUMBERS.

For example, it is correct to put a number like 171850 into a C++ program, but INCORRECT to write the number as 171,850 in a C++ program. If you use the comma, then the compiler will completely misunderstand the meaning of the number.

Also, when you test your program, DO NOT put commas in the numbers that you enter from the keyboard.

TESTING AND CORRECTNESS:

Your program must conform to the rules below. We will discuss and clarify the meaning of these rules in class.
  1. The test script must show testing of a representative sample of ordinary data. It must also show coverage on, and coverage near, at least two boundary data values.
  2. If your program gives an incorrect result when I run it, you may lose a very substantial amount of the credit for this assignment. (How tolerant would you be of a program that incorrectly calculates the taxes you owe?)
Here are a couple of ideas for checking on the correctness of your numbers:
  1. Include the tests from the sample runs among the tests you perform on your program, and verify that the answers your program gives are the same as the answers my program gave (to within $1.00).
  2. Go to this online tax calculator site. Make sure that "Single" is selected under "Step 1 Select your filing status." Enter one of your test inputs in the panel under "Step 2." (This calculator accepts only integer data.) Click where it says "Calculate Tax." The answer that appears should be no more than about three dollars different from your program's answer. Check more answers - maybe one for each income bracket.
DESIGN DETAILS:

Use double variables in this program for the income and the tax.


WHAT TO TURN IN:

You will be sending me two e-mail messages. Please follow these rules: Here is the list of things that you have to turn in: Note that there are no spaces in the subject lines given. It is important that you do not insert any spaces. My e-mail address is:

john@ishi.csustan.edu



WHEN IS THIS ASSIGNMENT DUE?

Look for the due date in the class schedule. (It's at the top level of the class directory.)