🔒 Closed [SOLVED]Python program

Status
Not open for further replies.

Phrog

Forum Veteran
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.webp

1662193310171.webp


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
 
Status
Not open for further replies.

About this Thread

  • 2
    Replies
  • 801
    Views
  • 2
    Participants
Last reply from:
Phrog

Online now

Members online
1,078
Guests online
850
Total visitors
1,928

Forum statistics

Threads
2,277,000
Posts
28,973,674
Members
1,229,682
Latest member
JhayPureno13
Back
Top