Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Write a program to compute a simple 3x3 spreadsheet containing integers and strings. First, input the spreadsheet source values from the console (in rows), then perform calculations as outlined below and finally output the computed spreadsheet as a matrix.
- Your program only needs to support integer formulae where a sequence of terms are added/subtracted. Assume that your columns (numbered A,B,C) and rows (numbered 1,2,3) will never be more than a single character and cell values/formulae have no spaces or errors. Examples of formulae are:
- =A1, =A1+B1, =A1+A2-A3, =B3-C3
- For that last few marks, note that your program will be tested for calculations that are not based on static cell values (think recursion)!
- Sample Input
- 1 2 3 4 5 6 =A1+A2 =B1+B2 =C1+C2
- Sample Output
- 1 2 3
- 4 5 6
- 5 7 9
- Sample Input
- John 12 23 David 45 67 Total =B1+B2 =C1+C2
- Sample Output
- John 12 23
- David 45 67
- Total 57 90
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement