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 tableCrew Members,Miles,Lanes,Days to Complete Part numberofstoplights Function
Write a function named numberofstoplights 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 numberofstoplightsmiles 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
stoplightsperintersection. 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 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
numberofintersections. 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 mile road, there will be 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 numberofintersections by the stoplightsperintersection to compute the total number of stoplights
required for this road project. Store this result in a variable named totalstoplights.
Finally, return the value stored in totalstoplights. Examples
numberofstoplights should return the value
numberofstoplights should return the value
numberofstoplights should return the value
numberofstoplights should return the value
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 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 to
Other Details
The trucks hauling asphalt have a maximum capacity of US tons
The standard road lane is feet wide.
Asphalt weighs lbs per cubic foot
Asphalt costs $ per ton
Power and water utilities are run under the road as part of all road projects
Power conduit is available only in ft lengths each length costs $
Water main pipe is available only in ft lengths each length costs $
There is one intersection for every mile of road
Stoplights cost $ per light look it up that's real!
Each intersection has two stoplights, plus one additional stoplight for each lane
Work days are hour days
All workers are paid $ per hour.
Crew members can complete an amount of work in a specified time according to the equation and table below:
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
