CS 1401, Quiz 12

Date:Tuesday, April 15, 2008
Name (please type legibly, ideally in block letters): ______________________________________________________________________
1. Mark what new material is covered and what is not covered in Chapter 12:

2-4. Today is the Tax Day, when US taxpayers have to file their taxes. Students get a special discount: e.g., the amount of tuition is not counted towards the taxes. In this quiz, we will use a simplified version of taxes.

2. Define a class Taxpayer in which each object has a name and an amount of income (in dollars). Do not forget to include a constructor method, accessor methods, and mutator methods.

3. Considering Taxpayer as a superclass, define a subclass Student in which there is also an additional field containing the amount of tuition. Add: constructor, accessor, mutator methods, and a method that computes taxable income by subtracting tuition from the income.

4. In the main method, define a new object of type Student with your name, income $4,000, and tuition $3,500, and return its taxable income. Trace your code step-by-step.