Rosie\'s Road Co. is a new local construction company. They are interested in bi
ID: 3748584 • Letter: R
Question
Rosie's Road Co. is a new local construction company. They are interested in bidding on new highway construction projects around the city. They've hired you to develop some software tools that they will use to help determine material needs and costs.
The city is very regular grid, with one 4-way intersection at each mile of road. When asking for a quote, the city sends out the number of linear miles of road, and how many total lanes (1 to 8).
Here's some information that you might find useful as you complete this challenge.
The trucks hauling asphalt have a maximum capacity of 5 US tons (10,000 lbs)
The standard road lane is 12 feet wide.
Asphalt weighs 145 lbs per cubic foot
Asphalt costs $150 per ton
Power and water utilities are run under the road as part of all road projects
Power conduit is available only in 20 ft. lengths - each length costs $400
Water main pipe is available only in 10 ft. lengths - each length costs $200
There is one intersection for every mile of road
Stoplights cost $25,000 per light (look it up, that's real!)
Each intersection has two stoplights, plus one additional stoplight for each lane
Work days are 8-hour days
All workers are paid $20 per hour
1 worker is able to install 1 mile of 2 lane road in 100 days. 2 workers would be able to install 1 mile of 2 lane road in 50 days. 1 worker is able to install 1 mile of 4 lane road in 200 days. 2 workers would be able to install 1 mile of 4 lane road in 100 days.
Road development is not only the asphalt you see - water and power conduits must be installed at the same time, and we have to account for things like labor costs and how long it will take to develop a particular project.
Functions
Part 1 - number_of_stoplights Function
Design and construct a function to calculate the number of stoplights needed for a project. The function must be named number_of_stoplights, and it must take two arguments in this order:
length of road project in miles
number of lanes
This function must return an int representing the number of stoplights needed for the project. Remember that there is one intersection for every mile of road, and each intersection has two stoplights, plus one additional stoplight for each lane - so an intersection on a four lane road would need a total of six stoplights (two, plus one for each of four lanes).
Part 2 - truckloads_of_asphalt Function
Design and construct a function to calculate the number of truckloads of asphalt needed for a project. The function must be named truckloads_of_asphalt, and it must take three arguments in this order:
length of road project in miles
number of lanes
depth of asphalt in inches
Your function must return an int representing the number of truckloads of asphalt needed for the project.
Part 3 - number_of_power_pipes & number_of_water_pipes Functions
Design and construct a function to calculate the number of power pipes needed for a project. This function must be named number_of_power_pipes - it will take the length of the project in miles as an argument, and it will return an int representing the number of power pipes needed for the project. Remember that pipe lengths should be whole numbers, and it's better to have too much pipe than too little - so round up.
Design and construct a function to calculate the number of water pipes needed for a project. This function must be named number_of_water_pipes - it will take the length of the project in miles as an argument, and it will return an int representing the number of water pipes needed for the project. Remember that pipe lengths should be whole numbers, and it's better to have too much pipe than too little - so round up.
Part 4 - number_of_crew_members Function
Design and construct a function to calculate the number of crew members to put on a given project, based on the project parameters. Note that the City requires the project to be completed in a certain time, so number of days should be an input to your function. This function must be namednumber_of_crew_members. Remember that you can't hire a half of a person, so round up. This function must take three arguments in this order:
length of road project in miles
number of lanes
number of days to complete the project
Overall Program
Part 5 - Rosie's Road Co. Program
Design and construct a complete program for Rosie's Road Co. Use the functions that you created in the previous challenges.
Your program should take as input from the user, the following.
Length of road project (miles)
Number of lanes
Depth of asphalt (inches)
Days to complete project
Your program should display a nicely formatted report with the following information - each on a seperate line.
Amount of materials needed
Truckloads of Asphalt
Stoplights
Water pipes
Power pipes
Number of crew members needed
Total cost of:
Asphalt (U.S.tons)
Stoplights
Water pipes
Power pipes
Labor
Total cost of project
Here is an example of what your program might look like when it runs:
=== Inputs ===================
Length of road project (miles) : 1
Number of lanes : 1
Depth of asphalt (inches) : 1
Days to complete project : 1
=== Amount of materials needed ===
Truckloads of Asphalt : 77
Stoplights : 3
Water pipes : 528
Power pipes : 264
Crew members needed : 50
=== Cost of Materials ============
Cost of Asphalt : 57750
Cost of Stoplights : 75000
Cost of Water pipes : 105600
Cost of Power pipes : 105600
Cost of Labor : 8000
=== Total Cost of Project ========
Total cost of project : 351950
I already posted this question, they only answred part 1 2 and 3. I need part 4 and 5 please in pyton!!!
I need it in python PLEASE!!!
Explanation / Answer
The solution consists answer for 3 sub-parts. The remaining sub-parts could be done in the same logical manner. Please find the code in Python below:
Python code:
import math
print("====Inputs==============")
length_of_road_in_miles = int(input("Length of road project(miles) "))
number_of_lanes = int(input("Number of lanes " ))
depth_of_asphalt = int(input("Depth of asphalt(inches) "))
// Part 1 solution number_of_stoplights Function
def number_of_spotlights(length_of_road_in_miles, number_of_lanes):
number_of_spotlight = (number_of_lanes + 2) * length_of_road_in_miles
return number_of_spotlight
// Part 2 - truckloads_of_asphalt Function solution
def truckloads_of_asphalt(length_of_road_in_miles, number_of_lanes, depth_of_asphalt):
truckload_of_asphalt = math.ceil(((length_of_road_in_miles * 5280) * (number_of_lanes * 12) * (depth_of_asphalt * 0.083) * 145) / 10000)
return truckload_of_asphalt
// Part 3 - number_of_power_pipes & number_of_water_pipes Functions solution
def number_of_power_pipes(length_of_road_in_miles):
number_of_power_pipe = math.ceil((length_of_road_in_miles * 5280) / 20)
return number_of_power_pipe
def number_of_water_pipes(length_of_road_in_miles):
number_of_water_pipe = math.ceil((length_of_road_in_miles * 5280) / 10)
return number_of_water_pipe
spotlight = number_of_spotlights(length_of_road_in_miles,number_of_lanes)
truckload = truckloads_of_asphalt(length_of_road_in_miles, number_of_lanes, depth_of_asphalt)
power_pipe = number_of_power_pipes(length_of_road_in_miles)
water_pipe = number_of_water_pipes(length_of_road_in_miles)
print("====Amount of materials needed=========")
print("Number of Spotlight ", spotlight)
print("Truckloads of asphalt ", truckload)
print("Number of Power pipes ", power_pipe)
print("Number of Water pipes ", water_pipe)
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.