Programming in Java

Lab 5

In this lab you will create a new main class to use with your spreadsheet class. This main class will read the data that will be entered into the spreadsheet. The data will be read from a file. The first line of the file will contain 4 numbers:

  1. the number of rows in the spreadsheet
  2. the number of columns in the spreadsheet
  3. the cell width
  4. the number of decimal places

The rest of the file will have a cell address and the contents of that cell on each line.

Your program should use a command line argument for the file name.

Each time the program reads a cell address and cell content, the cell content must be examined to determine whether it is a value, label, or formula. We can assume that labels will not contain an operator in the 3rd position. Once we know what type of content has been entered we can create the entry and add it to the spreadsheet.

After the data is read, the spreadsheet should be printed in display form (with formulas evaluated) and in raw form (with formulas unevaluated).

Make sure that you don't end up with a huge main function. Create other functions that get called from main.


Email Me | Office Hours | My Home Page | Department Home | MCC Home Page