The George Washington University
School of Engineering and Applied Science

Department of Electrical Engineering and Computer Science
CSci 131 -- Fall 1996
Project #3
Due Date: Nov. 7, 1996 (sect. 10); Nov. 11, 1996 (sect. 11)
Preliminary due dates for remaining projects:
Project 4--Nov. 21 (sect. 10); Nov. 25 (sect. 11)
Project 5--Dec. 5 (sect. 10); Dec. 9 (sect. 11)
This is the first of a series of projects in which you will develop data structures and underlying operations for an electronic spreadsheet system.

Background

As you probably know, programs like Lotus 1-2-3, Microsoft Excel, and Claris Works provide for setting up electronic worksheets or spreadsheets. These have a huge number of applications.

A spreadsheet is just a table of rows and columns, each of whose cells can contain either a value (integer, float, or string) or a formula. Each cell is addressed by its column and row coordinates. There are several addressing schemes; one common one is used by Excel, as shown in this image of a worksheet using Excel on a Macintosh.

As you can see in this simplified version of a gradesheet for a course, the columns are given by letters, the rows by numbers, so that the cell C4 contains Keith's second project grade. The headings in Row 1, the names in Column A, and the project grades in columns B through F, have been entered by the user as strings or integers, while the student averages in column G and the statistics in rows 14 and 15 have been computed by the spreadsheet program, based on formulas entered in the cells. For example, the studernt average in row 4 was computed by entering, into the cell G4, the formula

Average(B4:F4)

and the minimum project 1 grade was computed by entering, into the cell B14, the formula

Minimum(B3:B12)

Project

In this and the next two projects, we will build the software support for the data structures and computations of a reasonably good spreadsheet system. It is beyond the scope of CSci 131 to do the "graphical user interface (GUI)" in the image above. We will instead use ordinary files for our spreadsheet input data, and program code for the formulas.

Attached are the specs for two packages, Spreadsheet and Spreadsheet.IO, and the body of a demonstration program Use_Spreadsheet. Here is a display of an input file:

mfeldman@felix:10: cat spreadsheet.dat

George 20 19 19 18 17
Martha 20 20 20 15 20
Nguyen 15 20 19 18 17
Diane 20 20 19 18 17
Chuck 20 20 20 20 20
Fred 19 19 17 16 15
Ethel 15 20 20 19 15
Marianna 15 16 18 19 20
Keith 20 18 19 18 20
Arnold 20 20 20 19 20

Running the demonstration program produces this output:

mfeldman@felix:8: use_spreadsheet.exe <spreadsheet.dat

George        20    19    19    18    17
Martha        20    20    20    15    20
Nguyen        15    20    19    18    17
Diane         20    20    19    18    17
Chuck         20    20    20    20    20
Fred          19    19    17    16    15
Ethel         15    20    20    19    15
Marianna      15    16    18    19    20
Keith         20    18    19    18    20
Arnold        20    20    20    19    20

Minimum       15    16    17    15    15

Your project requires that you

1. develop and test the bodies of Spreadsheet and Spreadsheet.IO

2. modify the demonstration program so that it produces output rows and columns to match those in the Macintosh image above.