Write the function truck_adjustment_factor(truck_proportion, terrain_type) that takes the proportion of trucks using the motorway and the terrain type as inputs and returns the adjustment factor that is used for calculating the highway capacity. The adjustment factor is calculated according to the following formula: adju stment factor - proportie (fochor-1 Where proportion is the proportion of trucks and the factor is the car equivalent factor for the given terrain. You should be calling your car_equivalent_factor function to get the factor - don't reinvent the wheel! For example, for rolling terrain and a truck proportion equal to 0.12: adjustment factor = 1/(1 + 0.12 x (4.0 - 1)) = 0.735 Notes: • You should include (and call/use) your car_equivalent_factor function in your answer • In general, you should paste in your whole module so far in each question as later functions will call earlier functions. • You can assume the function will always be called with one of the three valid terrain types. For example: Test Result adjustment_factor = truck_adjustment_factor(8.12, 'level') print(f'{adjustment_factor:.3f}') 0.923 adjustment_factor = truck_adjustment_factor(8.12, 'rolling') 0.735 print(f'{adjustment_factor:.3f}') Answer: (penalty regime: 0, 10, 20, .. %) Ace editor not ready. Perhaps reload page? Falling back to raw text area.

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter6: Modularity Using Functions
Section6.1: Function And Parameter Declarations
Problem 10E
icon
Related questions
Question
Write the function truck_adjustment_factor(truck_proportion, terrain_type) that takes the proportion of trucks using the motorway and the terrain type as inputs and returns the adjustment factor that is used for
calculating the highway capacity. The adjustment factor is calculated according to the following formula:
adju stment factor = tprupurtime x(furtor-1)
Where proportion is the proportion of trucks and the factor is the car equivalent factor for the given terrain. You should be calling your car_equivalent_factor function to get the factor - don't reinvent the wheel!
For example, for rolling terrain and a truck proportion equal to 0.12:
adjustment factor = 1/(1 + 0.12 x (4.0 - 1)) = 0.735
Notes:
You should include (and call/use) your car_equivalent_factor function in your answer
o In general, you should paste in your whole module so far in each question as later functions will call earlier functions.
• You can assume the function will always be called with one of the three valid terrain types.
For example:
Test
Result
adjustment_factor = truck_adjustment_factor(0.12, 'level')
print(f'{adjustment_factor:.3f}')
0.923
adjustment_factor = truck_adjustment_factor(0.12, 'rolling') 0.735
print(f'{adjustment_factor:.3f}')
Answer: (penalty regime: 0, 10, 20, .. %)
Ace editor not ready. Perhaps reload page?
Falling back to raw text area.
Transcribed Image Text:Write the function truck_adjustment_factor(truck_proportion, terrain_type) that takes the proportion of trucks using the motorway and the terrain type as inputs and returns the adjustment factor that is used for calculating the highway capacity. The adjustment factor is calculated according to the following formula: adju stment factor = tprupurtime x(furtor-1) Where proportion is the proportion of trucks and the factor is the car equivalent factor for the given terrain. You should be calling your car_equivalent_factor function to get the factor - don't reinvent the wheel! For example, for rolling terrain and a truck proportion equal to 0.12: adjustment factor = 1/(1 + 0.12 x (4.0 - 1)) = 0.735 Notes: You should include (and call/use) your car_equivalent_factor function in your answer o In general, you should paste in your whole module so far in each question as later functions will call earlier functions. • You can assume the function will always be called with one of the three valid terrain types. For example: Test Result adjustment_factor = truck_adjustment_factor(0.12, 'level') print(f'{adjustment_factor:.3f}') 0.923 adjustment_factor = truck_adjustment_factor(0.12, 'rolling') 0.735 print(f'{adjustment_factor:.3f}') Answer: (penalty regime: 0, 10, 20, .. %) Ace editor not ready. Perhaps reload page? Falling back to raw text area.
Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Types of Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage