This assignment and all subsequent assignments are to be done with your homework partner.
Here is a class diagram:
+------------+
| Cell |<---------------------+-+
+------------+ | |
| int row | | |
| int col | | |
| IData data |-+ | |
+------------+ | | |
| | |
v | |
+-------+ | |
| IData | | |
+-------+ | |
/ \ | |
--- | |
| | |
----------------------------- | |
| | | |
+------------+ +----------+ | |
| Number | | Formula | | |
+------------+ +----------+ | |
| int number | | Cell op1 |---+ |
+------------+ | Cell op2 |-----+
+-| IFun fun |
| +----------+
v
+------+
| IFun |
+------+
/ \
---
|
------------------------
| | |
+------+ +---------+ +-------+
| Plus | | Minimum | | Times |
+------+ +---------+ +-------+
Here is an example of a spreadsheet that conforms to the above
definitions (for ease of reading, the columns are labelled
A, B, C... to represent columns 1, 2, 3...):
| A | B | C | D | E |
---+----------+----------+----------+----------+-----------+
1 | 8 | 3 | 4 | 6 | 2 |
---+----------+----------+----------+----------+-----------+
2 | mn A1 E1 | + B1 C1 | | | * B2 D1 |
---+----------+----------+----------+----------+-----------+
3 | * A1 A2 | + B2 B1 | | | mn A3 D1 |
---+----------+----------+----------+----------+-----------+
4 | | + B3 B2 | | | mn B4 D1 |
---+----------+----------+----------+----------+-----------+
5 | | + B4 B3 | | | * B5 E4 |
---+----------+----------+----------+----------+-----------+
Examples class, define cells representing each of the
occupied cells in the given picture.
value that computes the (integer) value of this cell.
countFunc that counts the number of
function applications needed to compute the value of this cell.
Create an archive of your project, and name your .zip file using the naming conventions for files. Turn in your .zip file using web-based turnin.