Question: IN PYTHON!! Problem Description and Given Info table [ [ Crew Members,Miles,Lanes,Days to Complete ] , [ 1 , 1 , 1 , 5

IN PYTHON!!
Problem Description and Given Info \table[[Crew Members,Miles,Lanes,Days to Complete],[1,1,1,50],[1,1,2,100],[1,2,1,100],[1,2,2,200],[2,1,1,25],[2,1,2,50],[2,2,1,50],[2,2,2,100]] Part 1- number_of_stoplights Function
Write a function named number_of_stoplights that takes two arguments (a float and an int) and returns a value (an int). The first
argument will be the length of the road project in miles, and the second argument will be the number of lanes for this road. When called,
this function should compute and return the number of stoplights needed for this road project.
Function Header
Here is a template for you to follow for this function:
def number_of_stoplights(miles, lanes):to calculate the total number of stoplights needed.Function Body
First, compute the number of stoplights for each intersection of this road and store this number in a variable named
stoplights_per_intersection. Remember that the number of lanes for this road will be stored in the parameter variable named
lanes. Also remember that at each intersection there will be two stoplights plus one more stoplight for each lane - for example, for a four
lane road, each intersection will have six stoplights (2 for the intersection itself, plus one more for each of the four lanes).
Second, compute the number of intersections for this length of road and store this number in a variable named
number_of_intersections. Remember that the length of the road (in miles) will be stored in the parameter variable named miles.
Also remember that there will be one intersection for each full mile of road - for example, for a 2.75 mile road, there will be 2 intersections,
because there is one intersection for each full mile of road. You may use the int or math.floor functions to perform the necessary rounding
operation.
Third, multiply the number_of_intersections by the stoplights_per_intersection to compute the total number of stoplights
required for this road project. Store this result in a variable named total_stoplights.
Finally, return the value stored in total_stoplights. Examples
number_of_stoplights(1.0,1) should return the value 3
number_of_stoplights(1.0,2) should return the value 4
number_of_stoplights(2.0,1) should return the value 6
number_of_stoplights(2.75,3) should return the value 10
You may wish to write some additional code to test your function. Please be sure that you delete (or comment out) any test code before
you submit your solution. The only code in your solution should be the required function definition.
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.
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.
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).
Other Details
The trucks hauling asphalt have a maximum capacity of 5 US tons (10,000lbs)
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.
Crew members can complete an amount of work in a specified time according to the equation and table below:
IN PYTHON!! Problem Description and Given Info \

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!