Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You're contracted to work with a trucking freight company We Like to Move it , Move it ! . The hourly rates for drivers are
You're contracted to work with a trucking freight company We Like to Move it Move it The
hourly rates for drivers are $ per hour and $ per hour. The operating cost of the truck is in
cents per mile,
truck
where are distance and speed, respectively. The total cost is then:
drivertruck
where is the hourly rate and is the time for which the driver drove the truck. You inform the
company that this is an optimization problem, given a fixed salary and distance. In particular, you
say that since the speed must be from to there is an optimal speed that reduces
cost Implement the functions that allow you to determine for a fixed distance and salary well
look at both the speed that reduces cost. The following code:
hrrate
distance
printmincostdistance hrrate, sasb
rate
printmincost distance hrrate, sasb
produces:
One aspect of the problem you must pay attention to is the different units: dollars and cents.
These cannot be added together, since they're different units, eg dollar plus cent
Either you have or
Deliverables Problem
Complete the functions following the algorithm described above.
The return type of mincost is a tuple where is the cost and the speed.
Round cost to decimal places.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started