spreadsheet

Submit

Your name:
File:
Open code-statistics:

Language is selected by the extension of the file. See the list of supported languages to know the extension of your language.

Problem

Implement a simple spreadsheet package that supports addition, subtraction, multiplication, division, and square roots.

Your submission will be provided a tab-delimited file containing the contents of each cell. It must produce output identical to the same file copy/pasted into OpenOffice.org Calc and then copy/pasted from that program into a text editor. (That is, your submission must find the value, accurate to two decimal places, of each cell containing a formula.)

Options

exec is denied

now post-mortem time, all source codes will be revealed

Sample input:_

Acme Computer Co. Official Invoice				
Qty.	Description	Price	Extended Price	Total
7	Rack Mount Servers	795	=A3*C3	=D3
3	16 GB Flash Drives	59.99	=A4*C4	=E3+D4
6	Wireless Mice	42.99	=A5*C5	=E4+D5
2	1080p HDTVs	388.88	=A6*C6	=E5+D6
0	Desk Lamps	14.99	=A7*C7	=E6+D7
1	Armchair	144.95	=A8*C8	=E7+D8
5	Power Cords	0.99	=A9*C9	=E8+D9
				
	Sales Tax	0.08	=C11*E9	
				
	PLEASE PAY THIS AMOUNT ==========			=E9+D11

Sample output:

Acme Computer Co. Official Invoice				
Qty.	Description	Price	Extended Price	Total
7	Rack Mount Servers	795	5565	5565
3	16 GB Flash Drives	59.99	179.97	5744.97
6	Wireless Mice	42.99	257.94	6002.91
2	1080p HDTVs	388.88	777.76	6780.67
0	Desk Lamps	14.99	0	6780.67
1	Armchair	144.95	144.95	6925.62
5	Power Cords	0.99	4.95	6930.57
				
	Sales Tax	0.08	554.45	
				
	PLEASE PAY THIS AMOUNT ==========			7485.02

Sample input:_

Find the standard deviation of	30	data points.		
Data Point	Total	Error	Squared Error	Total Squared Error
52	=A3	=A3-B34	=C3*C3	=D3
46	=B3+A4	=A4-B34	=C4*C4	=E3+D4
45	=B4+A5	=A5-B34	=C5*C5	=E4+D5
38	=B5+A6	=A6-B34	=C6*C6	=E5+D6
47	=B6+A7	=A7-B34	=C7*C7	=E6+D7
44	=B7+A8	=A8-B34	=C8*C8	=E7+D8
33	=B8+A9	=A9-B34	=C9*C9	=E8+D9
39	=B9+A10	=A10-B34	=C10*C10	=E9+D10
31	=B10+A11	=A11-B34	=C11*C11	=E10+D11
33	=B11+A12	=A12-B34	=C12*C12	=E11+D12
55	=B12+A13	=A13-B34	=C13*C13	=E12+D13
46	=B13+A14	=A14-B34	=C14*C14	=E13+D14
45	=B14+A15	=A15-B34	=C15*C15	=E14+D15
39	=B15+A16	=A16-B34	=C16*C16	=E15+D16
48	=B16+A17	=A17-B34	=C17*C17	=E16+D17
46	=B17+A18	=A18-B34	=C18*C18	=E17+D18
37	=B18+A19	=A19-B34	=C19*C19	=E18+D19
33	=B19+A20	=A20-B34	=C20*C20	=E19+D20
27	=B20+A21	=A21-B34	=C21*C21	=E20+D21
26	=B21+A22	=A22-B34	=C22*C22	=E21+D22
36	=B22+A23	=A23-B34	=C23*C23	=E22+D23
27	=B23+A24	=A24-B34	=C24*C24	=E23+D24
25	=B24+A25	=A25-B34	=C25*C25	=E24+D25
23	=B25+A26	=A26-B34	=C26*C26	=E25+D26
24	=B26+A27	=A27-B34	=C27*C27	=E26+D27
25	=B27+A28	=A28-B34	=C28*C28	=E27+D28
21	=B28+A29	=A29-B34	=C29*C29	=E28+D29
21	=B29+A30	=A30-B34	=C30*C30	=E29+D30
16	=B30+A31	=A31-B34	=C31*C31	=E30+D31
14	=B31+A32	=A32-B34	=C32*C32	=E31+D32
				
Mean	=B32/B1			
Variance (n-1)	=E32/(B1-1)			
Standard Deviation (n-1)	=SQRT(B35)			

Sample output:

Find the standard deviation of	30	data points.		
Data Point	Total	Error	Squared Error	Total Squared Error
52	52	17.27	298.14	298.14
46	98	11.27	126.94	425.08
45	143	10.27	105.4	530.48
38	181	3.27	10.67	541.15
47	228	12.27	150.47	691.62
44	272	9.27	85.87	777.49
33	305	-1.73	3	780.5
39	344	4.27	18.2	798.7
31	375	-3.73	13.94	812.64
33	408	-1.73	3	815.64
55	463	20.27	410.74	1226.38
46	509	11.27	126.94	1353.32
45	554	10.27	105.4	1458.72
39	593	4.27	18.2	1476.93
48	641	13.27	176	1652.93
46	687	11.27	126.94	1779.87
37	724	2.27	5.14	1785.01
33	757	-1.73	3	1788.01
27	784	-7.73	59.8	1847.82
26	810	-8.73	76.27	1924.09
36	846	1.27	1.6	1925.69
27	873	-7.73	59.8	1985.5
25	898	-9.73	94.74	2080.24
23	921	-11.73	137.67	2217.91
24	945	-10.73	115.2	2333.11
25	970	-9.73	94.74	2427.85
21	991	-13.73	188.6	2616.45
21	1012	-13.73	188.6	2805.06
16	1028	-18.73	350.94	3156
14	1042	-20.73	429.87	3585.87
				
Mean	34.73			
Variance (n-1)	123.65			
Standard Deviation (n-1)	11.12			

Sample input:_

=E9+E4+F1+H4	826	368	702	340	431	=D6*A4+G9+C3	562	=E10-D9	362
325	=H7/D1-A4+G4	578	356	=C1*B1/J4/B7-J8	905	626	25	=B9/E7	414
512	=E5-A5	361	504	622	933	949	411	873	465
533	154	730	46	265	69	587	904	837	181
853	=G6/H5+G5/J8/J8-A1	=A4/J9/I8-J7	21	296	686	973	290	710	505
687	674	59	=H7/G2+F7+E4+B4	487	173	521	548	11	567
=B6-G5/I6	399	440	33	179	91	64	413	344	82
282	425	332	754	926	880	=D2-A9*D3	668	764	38
65	365	=G2/E7+D8-D10-C10	366	781	=I5*H10	=H5+G10	331	86	945
856	280	2	473	245	164	612	=C10*J8-G4	36	609

Sample output:

2381	826	368	702	340	431	273444.64	562	-121	362
325	54.59	578	356	-33.79	905	626	25	2.04	414
512	-557	361	504	622	933	949	411	873	465
533	154	730	46	265	69	587	904	837	181
853	-2378.53	-82	21	296	686	973	290	710	505
687	674	59	510.66	487	173	521	548	11	567
585.55	399	440	33	179	91	64	413	344	82
282	425	332	754	926	880	-32404	668	764	38
65	365	282.5	366	781	-362810	902	331	86	945
856	280	2	473	245	164	612	-511	36	609

Ranking

Ruby _

RankUserSizeTimeDateStatistics
1hide242170.69442010/10/30 06:20:030B / 79B / 134B
2uru2410.18382010/10/30 00:22:380B / 116B / 109B

Perl _

RankUserSizeTimeDateStatistics
1tybalt891470.26732010/10/25 02:11:110B / ?B / ?B
2dcutter2180.20212010/10/28 04:06:380B / 93B / 123B
3MG4950.12082010/10/24 11:11:370B / 208B / 285B

Python _

RankUserSizeTimeDateStatistics
1hallvabo (bin)2670.15422010/10/30 22:53:01141B / 73B / 49B
2hallvabo2920.14642010/10/26 21:38:280B / 154B / 110B
3recursive3410.16222010/10/27 03:02:130B / 176B / 134B

JavaScript _

RankUserSizeTimeDateStatistics
1idealmachine(rand)2780.12532010/10/27 05:37:490B / 152B / 124B
2idealmachine2880.12582010/10/27 05:23:330B / 157B / 130B

J _

RankUserSizeTimeDateStatistics
1I., S.2580.30152010/10/30 14:40:210B / 58B / 191B
2I., S.(less robust)2230.64722011/03/08 22:06:550B / 53B / 158B
3I., S.2280.67672010/12/11 06:11:120B / 53B / 163B

Bash _

RankUserSizeTimeDateStatistics
1idealmachine2960.11032010/10/29 09:49:090B / ?B / ?B
2teebee1470.22472010/10/31 14:12:260B / ?B / ?B

Zsh _

RankUserSizeTimeDateStatistics
1idealmachine2960.12022010/10/29 09:49:230B / ?B / ?B

Fish _

RankUserSizeTimeDateStatistics
1idealmachine2960.18912010/10/29 09:49:300B / ?B / ?B

Language Ranking_

RankLangUserSizeScore
1Perltybalt8914710000
2Bashteebee14710000
3Rubyhide242176774
4JI., S.(less robust)2236591
5Pythonhallvabo (bin)2675505
6JavaScriptidealmachine(rand)2785287
7Zshidealmachine2964966
8Fishidealmachine2964966

return to the top page