CS 2135 (C03) Homework 4: Defining Languages

Due: February 12 (Thursday) at 11:59pm via turnin (assignment name hwk4).

Assignment Goals


The Assignment

Imagine that you were asked to implement a tax-preparation program such as TurboTax. Such programs change only slightly from year to year: the tax rates and some questions asked may change, but the core of a taxes program is the same from year to year (query the user for information, compute values for different lines). This is a good indication that there is a "language" of tax forms such that someone can write the new tax form program each year, but use the same underlying program (interpreter) to prepare the tax forms.

For this assignment, you will design a language of tax forms. You will NOT write the interpreter that runs the forms. This is an assignment in language design only.

Your language must be sufficient to capture the non-blacked-out portions of the following tax form and schedules:

Your language should be sufficient to capture all of the non-blacked-out portions of these two forms. If your language design is sufficient, then someone should be able to write an interpreter for it that would prompt a user for the information needed to compute that user's taxes; which prompts to give (and when) should be contained within your tax form language. Similarly, instructions to compute intermediate values needed in a tax computation should be part of your language. The interpreter should not need any information other than your program and the tax tables (which you will ignore for this assignment) to compute taxes. Remember that your goal is to produce a language that would let someone "program" different tax forms without changing the underlying interpreter.


What to Turn In

Turn in a single file hwk4.ss (or hwk4.scm) containing the data definitions and tax form example programs. Make sure that both students' names are in a comment at the top of the file.


Hints and Guidelines


Back to the Assignments page