Temperature Conversion Table

Loop over values of f, compute c, print as table with headings. The slightly simpler feet to meters conversion was the first program I ever wrote.

Recreated in coffeescript:

console.log "F\tC" for f in [0..100] by 5 c = 5/9*(f-32) console.log "#{f}\t#{c.toFixed 2}"

Produces this output:

F	C
0	-17.78
5	-15.00
10	-12.22
15	-9.44
20	-6.67
25	-3.89
30	-1.11
35	1.67
40	4.44
45	7.22
50	10.00
55	12.78
60	15.56
65	18.33
70	21.11
75	23.89
80	26.67
85	29.44
90	32.22
95	35.00
100	37.78

pages/temperature-conversion-table