What's new

Closed [SOLVED]Python program

Status
Not open for further replies.

Phrog

Forum Veteran
Elite
Joined
Jan 25, 2017
Posts
2,131
Reaction
1,379
Points
637
May program po na pinapagawa samin, ehh may code na po ako, kaso feel ko po mali, kasi po
pag 212 °F(100 °C) nag sosound padin po alam, ehh boiling point na po sya. Dapat po kasi pag
freezing temp(in fahrenheit) mag aalarm ang sound eto po instructions, medyo di ko lang po
gets kasi di ko alam yung equation, although may constant na. Sa formula lang po ako nalilito.
Thank you po in advance.

1662193285143.png

1662193310171.png


Python:
B = 3310
R0 = 33192 + 273.15
T0 = 40 + 273.15
R2 = 156300
R3 = 156300
R4 = 156300

temp = int(input("Enter temperature in Fahrenheit: "))
temp = temp + 273.15

R = R0 * B * (1/temp - 1/T0)

p1 = R2 / (R + R2)
p2 = R4 / (R3 + R4)

if p1 < p2:
    print("The alarm will sound with this output: " + str(p1) + " < " + str(p2))
elif p1 > p2:
    print("The alarm will not sound with this output: " + str(p1) + " > " + str(p2))
else:
    print("Error")
#Ouput
#Enter temperature in Fahrenheit: 76
#The alarm will not sound with this output: 1.3043688915265668 < 0.5
 

Attachments

Status
Not open for further replies.
Back
Top