Studi Kasus 4 : Konversi Suhu

 Buat program Pyhton untuk mengkonversi suhu dari Celcius ke satuan suhu lainnya. Rumus yang digunakan diambil dari table berikut


Jawaban :

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#Celcius ke Kelvin
def CelciustoKelvin(C):
    K = C + 273.15
    print('Konversi Suhu Celcius ke Kelvin: ', K)
CelciustoKelvin(35)

#Celcius ke Fahrenheit
def CelciustoFahrenheit(C):
    F = (C * 1.8) + 32
    print('Konversi Suhu Celcius ke Fahrenheit : ', F)
CelciustoFahrenheit(35)

#Celcius ke Rankine
def CelciustoRankine(C):
   Ra = 1.8 * (C + 491.67)
   print('Konversi Suhu Celcius ke Rankine : ', Ra)
CelciustoRankine(35)

#Celcius ke Delisle
def CelciustoDelisle(C):
   De = (100 - C) * 1.5
   print('Konversi Suhu Celcius ke Delisle : ', De)
CelciustoDelisle(35)

#Celcius ke Newton
def CelciustoNewton(C):
   N = C * 33 / 100
   print('Konversi Suhu Celcius ke Newton : ', N)
CelciustoNewton(35)

#Celcius ke Reamur
def CelciustoReamur(C):
   Re = C * 0.8
   print('Konversi Suhu Celcius ke Reamur : ', Re)
CelciustoReamur(35)

#Celcius ke Romer
def CelciustoRomer(C):
   Ro = C * 21 / 40 + 75 
   print('Konversi Suhu Celcius ke Romer : ', Ro)
CelciustoRomer(35)


Hasil :