about | help | code help+videos | done | prefs |
Define a function that when passed three floating-point values, the first representing distance between two locations, the second representing the average speed of one-way trip, and the third representing the required average speed of the entire return-trip, returns the speed at which you must return to achieve the expected overall average. For example, if A and B are 60 kms apart, you travel from A to B @ 30kmph, and the overall average speed should be 40kmph, then you must return from B to A @60kmph. We will let you work out the math. return_speed(60, 30, 40) → 60.0 return_speed(100, 80, 90) → 102.85714285714285 return_speed(12, 9, 5) → 3.4615384615384612 ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 1 Post-solution available
Copyright Nick Parlante 2017 - privacy