All pastes #272075 Raw Edit

Anonymous

public ruby v1 · immutable
·published 2006-12-08 18:30 UTC
rendered paste body
#!/usr/bin/ruby# f2c: 5*(F - 32)/9# c2f: 9*C/5 + 32degrees = ARGV[0]current = degrees[0, degrees.length - 1].to_ffc = degrees[-1,1]if (fc == "f")  converted = 5 * (current - 32) / 9  puts "#{current}°F = #{converted}°C"elsif (fc == "c")   converted = 9 * current / 5 + 32  puts "#{current}°C = #{converted}°F"else  puts "ERROR: #{fc} is not a valid unit of measure."end