Ивайло обнови решението на 17.10.2016 16:15 (преди около 9 години)
+def convert_between_temperature_units(degrees, unit_from, unit_to)
+  if unit_from == "C"
+    if unit_to == "K"
+      degrees + 273.15  
+    elsif unit_to == "F"
+      degrees * 1.8 + 32
+    end
+  
+  elsif unit_from == "K"
+    if unit_to == "C"
+      degrees - 273.15
+    elsif unit_to == "F"
+      degrees * 1.8 - 459.67
+    end
+  
+  elsif unit_from == "F"
+    if unit_to == "C"
+      (degrees - 32) / 1.8 
+    elsif unit_to == "K"
+      (degrees + 459.67) * 5 / 9
+    end
+  end
+end
+
+def melting_point_of_substance(substance, unit)
+  melting_point = { 
+    "water" => 0, "ethanol" => -114, "gold" => 1064,
+    "silver" => 961.8, "copper" => 1085 
+  }
+  
+  if unit == "C"
+    melting_point[substance]
+  
+  else
+    convert_between_temperature_units(melting_point[substance], "C", unit)
+  end
+end
+
+def boiling_point_of_substance(substance, unit)
+  boiling_point = { 
+    "water" => 100, "ethanol" => 78.37, "gold" => 2700,
+    "silver" => 2162, "copper" => 2567 
+  }
+  
+  if unit == "C"
+    boiling_point[substance]
+  
+  else
+    convert_between_temperature_units(boiling_point[substance], "C", unit)
+  end
+end
