In: Computer Science
Write a rudimentary spreadsheet program using C++. Display a grid of cells with columns A through H and rows 1 through 20. Accept input in the first row of the screen. The commands are of the form column row entry, where entry is a number, a cell address preceded by a plus (e.g., +A5), a string, or a function preceded by an at sign, @. The functions are: max, min, avg, and sum. During execution of your program, build and modify the graph reflecting the situation in the spreadsheet. Show the proper values in proper cells. If a value in a cell is updated, then the values in all cells depending on it should also be modified. For example, after the following sequence of entries:
A1 10
B1 20
A2 30
D1 +A1
C1 @sum(A1..B2)
D1 +C1
both cells C1 and D1 should display the number 60.
The easiest way to draw this spreadsheet is to print it out in the terminal using cout. You should consider locking the number of cells in the spreadsheet and using ascii characters to represent the lines.