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.
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.
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
-
You do not have permission to view the full content of this post. Log in or register now.