Pure Programmer
Blue Matrix


Cluster Map

Project: Temperature Class

Write a mutable class to represent thermodynamic temperature. The internal representation should be in Celcius but there should be setters and getters for all four temperature scales: Celcius, Fahrenheit, Kelvin and Rankine. A single default constructor should set the temperature to 0°K.

See [[Temperature]]

Output
$ python3 TemperatureClass.py Celcius: -273.15 Kelvin: 0.00 Fahrenheit: -459.67 Rankine: 0.00 Celcius: 100.00 Kelvin: 373.15 Fahrenheit: 212.00 Rankine: 671.67 Celcius: -40.00 Kelvin: 233.15 Fahrenheit: -40.00 Rankine: 419.67 Celcius: 100.00 Kelvin: 373.15 Fahrenheit: 212.00 Rankine: 671.67 Celcius: 100.00 Kelvin: 373.15 Fahrenheit: 212.00 Rankine: 671.67

Solution