CS365 Project Assignment 5

In this assignment your team is going to create a user interface for the spreadsheet interpreter that you wrote in the previous assignment. I want to give your team an opportunity to do some creative design for this assignment but I want your interface to look like a spreadsheet and to include the following elements and functions:

  1. Each column should be labeled with the name of that column and each column should have 10 rows. This number can be fixed for this assignment.

  2. It should be possible to add a new column either before or after an existing column. The user should be prompted for the name of the column when it is created and if you wish you can forbid the user from changing the name thereafter. Alternatively you can allow the user to change the column name up until the point where the column is referenced in a formula (the problem with allowing the user to edit the names of the columns after they appear in a formula is that you would have to find all cell references in your expression trees with the previous column name and change it--in a commercial application I would make you do this). One issue for your team to grapple with is the best look for the initial interface. Should there be no columns to start with, one column, multiple columns, etc? Your decision about when column names become fixed will help determine what your initial screen looks like.

  3. It should be possible to enter a new formula or value for a cell(s). When a cell is updated all cells in the spreadsheet that depend on it should be updated and should display their new values. If a series of cells is updated via a generic formula then the entire set of new formulas/values should be assigned and the spreadsheet should be updated only once. Ideally it should be possible to either select a cell and enter a formula (in which case your gui can add the left hand side cell reference before passing the formula to your interpreter) or to enter a formula into a formula text field.

  4. When the user types in a bad formula/value, an error message should be displayed in a dialog box. The bad formula/value should remain displayed so that the user can modify it.

  5. There should be a quit option that allows the user to exit the application.

Your team is welcome to introduce additional features for extra credit. When you submit your project make sure you document these features so we can evaluate them and decide how much extra credit to assign. An example of an additional feature might be highlighting undefined formula values in a special color.

Sample Interface

In a few days I will post a sample executable that you are free to follow if you decide not to design your own interface.

What to Submit

Place your code in a package named formula. Your main class should be called spreadsheet. Follow the submission instructions at Michael Beeler's TA website.