这是代码:
导入数学
def query():
road_length = int((float(input('Insert the amount of road length that is needed in miles: '))))
num_lanes = int(input('Insert the amount of lanes that are wished for this highway: '))
depth_asphalt_inches = int(input('Insert the total asphalt depth that you wish to use in inches: '))
pipe_power_length = int(input('Insert the amount of pipe that will be placed underground: '))
def calc_num_stoplights(road_length,num_lanes):
query()
stoplights = (2 + num_lanes) * road_length
print(stoplights)
return stoplights
def calc_asphalt_truckloads(road_length,num_lanes,asphalt_depth_inches):
query()
road_to_ft = road_length * 5280
lanes_to_ft = num_lanes * 12
depth_asphalt = asphalt_depth_inches / 12
volume_asphalt_ft = depth_asphalt * road_to_ft * lanes_to_ft
weight_asphalt = volume_asphalt_ft * 145
asphalt_quantity_use = round(weight_asphalt / 10000)
calc_asphalt_truckloads = asphalt_quantity_use
print(calc_asphalt_truckloads)
return calc_asphalt_truckloads
def calc_pipe_power_need(road_length,pipe_power_length):
power_cable = road_length * 5280 / 20
water_pipe = road_length * 5280 / 10
round(power_cable)
round(water_pipe)
print(calc_pipe_power_need)
return(calc_pipe_power_need)
query()
calc_pipe_power_need()