CCCPaste

Quiz2_Set1

flight_height = int(input('Enter the height of the flight: '))
km_to_travle = int(input('Enter the KM to travle: '))
wind_cond = input('Wind Condition (H/C/T) : ')

wind_cond = wind_cond.lower()

fuel_percent = 0

if wind_cond == 'h':
    fuel_percent = 0.05
elif wind_cond == 'c':
    fuel_percent = 0.02
else:
    fuel_percent = -0.04


if flight_height < 10000 or flight_height > 35000:
    print('NO Fly Zone')
else:
    fuel_comp = 0
    
    #t = s/v
    total_min = km_to_travle / (1000/100) # distance / velocity

    total_min += total_min * fuel_percent # time + (time * fuel_percent)

    # n = q.60+r
    time_hour = total_min//60
    # r = n - (q*60)
    time_min = total_min - (time_hour*60)

    if flight_height > 25000:
        fuel_comp = km_to_travle * (1000/1000)
        fuel_comp += fuel_comp * fuel_percent
    elif flight_height > 20000:
        fuel_comp = km_to_travle * (1500/1000)
        fuel_comp += fuel_comp * fuel_percent
    else:
        fuel_comp = km_to_travle * (2000/1000)
        fuel_comp += fuel_comp * fuel_percent
    
    print(f"AirPlane should carry {fuel_comp} liters of fuel.")
    print(f"Flight will be {int(time_hour)} hours and {int(time_min)} minutes long.")