Professional Documents
Culture Documents
Activity 2
Activity 2
Activity 2
SELECTION STATEMENTS
SUBMITTED BY:
Abrigo, Renz Christian, B.
COE - 1203
SUBMITTED TO:
Sir Mark Rondol P. Abdon
A. Create a simple Python HVAC (Heating, Ventilation, and Air Conditioning) system's operation based on the
outdoor temperature.
Paste your code here use comments to properly document your program.
print("Abrigo, Renz Christian B.\nCOE-1203\nACTIVITY 2: Selection Statements")
#Task A
#Prompt the user to input the outdoor temperature in Fahrenheit.
temperature = float(input("Enter the outdoor temperature in Fahrenheit: "))
comfort.")
elif (temperature >= 65) and (temperature < 80):
print ("The outdoor temperature is: ", temperature, "degrees Fahrenheit",
"\nBegin cooling operations. \nEnsure all cooling units are operational.")
else:
print("The outdoor temperature is: ", temperature, "degrees Fahrenheit",
"\nActivate cooling systems. \nOptimize airflow to maintain a comfortable
indoor temperature.")
# Task B
# Create a program that calculates airspeed based on altitude and temperature
# Take input for altitude (in feet) and temperature (in Fahrenheit) from the
user.
altitude = float(input("Enter altitude (in feet): "))
temperature = float(input("Enter temperature (in Fahrenheit): "))
# If no errors are found, calculate and print the airspeed, and report in 2
decimal points
else:
print("The calculated airspeed is: ", airspeed, "units")
Task A:
Task B:
Calculated the airspeed: