Стоян обнови решението на 16.10.2016 23:38 (преди около 8 години)
+def convert_between_temperature_units(degree, unit1, unit2)
+ if unit1 == 'C' && unit2 == 'F'
+ degree = degree * 1.8000 + 32
+ elsif unit1 == 'C' && unit2 == 'K'
+ degree += 273.15
+ elsif unit1 == 'C' && unit2 == 'C'
+ degree
+ elsif unit1 == 'F' && unit2 == 'K'
+ degree = (degree + 459.67) / 1.8000
+ elsif unit1 == 'K' && unit2 == 'F'
+ degree = degree * 1.8000 - 459.67
+ elsif unit1 == 'K' && unit2 == 'C'
+ degree -= 273.15
+ elsif unit1 == 'F' && unit2 == 'C'
+ degree = (degree - 32) / 1.8000
+ elsif unit1 == 'F' && unit2 == 'F'
+ degree
+ elsif unit1 == 'K' && unit2 == 'K'
+ degree
+ end
+end
+
+def melting_point_of_substance(name, unit)
+ if name == 'water' && unit == 'C'
+ 0
+ elsif name == 'water' && unit == 'K'
+ 273.15
+ elsif name == 'water' && unit == 'F'
+ 32
+ elsif name == 'ethanol' && unit == 'C'
+ -114
+ elsif name == 'ethanol' && unit == 'K'
+ 159.14
+ elsif name == 'ethanol' && unit == 'F'
+ -173.20
+ elsif name == 'gold' && unit == 'C'
+ 1064
+ elsif name == 'gold' && unit == 'K'
+ 1337.15
+ elsif name == 'gold' && unit == 'F'
+ 1947.2
+ elsif name == 'silver' && unit == 'C'
+ 961.8
+ elsif name == 'silver' && unit == 'K'
+ 1234.94
+ elsif name == 'silver' && unit == 'F'
+ 1763.24
+ elsif name == 'copper' && unit == 'C'
+ 1085
+ elsif name == 'copper' && unit == 'K'
+ 1358.15
+ elsif name == 'copper' && unit == 'F'
+ 1985
+ end
+end
+
+def boiling_point_of_substance(name, unit)
+ if name == 'water' && unit == 'C'
+ 100
+ elsif name == 'water' && unit == 'K'
+ 373.15
+ elsif name == 'water' && unit == 'F'
+ 212
+ elsif name == 'ethanol' && unit == 'C'
+ 78.37
+ elsif name == 'ethanol' && unit == 'K'
+ 351.52
+ elsif name == 'ethanol' && unit == 'F'
+ 173.06
+ elsif name == 'gold' && unit == 'C'
+ 2700
+ elsif name == 'gold' && unit == 'K'
+ 2973.15
+ elsif name == 'gold' && unit == 'F'
+ 4892
+ elsif name == 'silver' && unit == 'C'
+ 2162
+ elsif name == 'silver' && unit == 'K'
+ 2435.15
+ elsif name == 'silver' && unit == 'F'
+ 3923.6
+ elsif name == 'copper' && unit == 'C'
+ 2567
+ elsif name == 'copper' && unit == 'K'
+ 2840.15
+ elsif name == 'copper' && unit == 'F'
+ 4652.6
+ end
+end