Programming assignment 1


Discuss at http://guzdial.cc.gatech.edu:8080/cs2390.22

Problem Statement

The user needs to create a spreadsheet. Cells are specified by strings of the form "A1" -- a letter and a digit. There will be no more than 26 columns (A-Z) and 9 rows (1-9). You may assume that all cell specifications will be correct (e.g., no one references a cell that hasn't been created yet, all column references are uppercase letters, etc.) The user would like to use these spreadsheets with Workspace code that looks like this:

| ss1 |
ss1 := Spreadsheet new.
ss1 cell: 'A1' put: 15.     "Puts 15 into cell A1"
ss1 cell: 'A2' put: 30.
ss1 cell: 'A3' put: 75.2.
Transcript cr; show: (ss1 solve: 'SUM(A1:A3)') printstring.  "Prints the sum (120.2) to the Transcript"
Transcript cr; show: (ss1 cell: 'A1') printstring. "Prints 15 to the Transcript"

ss1 cells: #(24 76.4 19 37 89) putIn: 'B'. "Fill five cells B1..B5 of the spreadsheets with these values" Transcript cr; show: (ss1 solve: 'A1+B1') printstring. "Prints 39 to the Transcript" Transcript cr; show: (ss1 solve: 'AVERAGE(B1:B5)') printstring. "Prints the average (49.08) to the Transcript"

"Create a cell that sums the values of two Spreadsheets" ss1 cell: 'C1' solve: 'SUM(A1:A3)'. Transcript cr; show: (ss1 cell: 'C1') printstring. "Prints the sum 120.2 to the Transcript"

ss1 open. "Opens up the HIC View on the Spreadsheet -- ADDED 2/9"

In summary, methods that spreadsheets should understand include:

Special notes to consider:

HIC for Spreadsheets

The user is pretty comfortable entering Smalltalk code, so it's okay to always use cell:put: and cells: messages for entering values into cells. However, the user does want to see:

This is what the user should see after the ss1 open above. I don't recommend using Squeak-UI.st for this -- use a StringHolder as discussed in the CS2390 CoWeb. Do this in a really simple way, e.g.:


A1: 15 - B1: 24 - C1: 120.2 (SUM(A1:A3))
A2: 30 - B2: 76.4 - C2: 0
A3: 75.2 - B3: 19 - C3: 0
A4: 89.9 - B4: 37 - C4: 0
A5: 0 - B5: 89 - C5: 0

Notes:

HINTS AND SUGGESTIONS


News Page | CS2390 Win'98 Home Page | CS2390 CoWeb | STABLE | BOOST
Questions/comments/concerns to guzdial@cc.gatech.edu
Page last updated 2/12/98; 9:32:44 AM