Question: You will need a Python repl to solve part C. This easiest way to write this function is by calling your function from part A1,

You will need a Python repl to solve part C. This easiest way to write this function is by calling your function from part A1, so you should write this function using the same repl as part A just below those function definitions.

Define a function to_metric that has three inputs. The first input will have a float value which represents the circumference of a tire (as a fraction of a mile). The second input will have an int value which represents the number of times the tire has rotated. The third input will have a float value which represents the number of hours traveled. First, multiply the first two parameters to calculate the distance travelled (in miles). It is expected, but not required, you then call your to_kph function from part A1 using the calculated distance travelled and the third parameter as the arguments. However it is calculated, your function should return the tire's velocity in kilometers per hour.

Sample test cases: to_metric(0.001, 1000, 1.0) would evaluate to 1.60934 (finds bug in conversion of first and second parameters into distance) to_metric(0.001, 0, 1.0) would evaluate to 0.0 (finds bug in handling of a distance equivalent to 0) to_metric(0.001, 1000, -1.0) would evaluate to -1.60934 (finds bug in how third parameter used)

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 Databases Questions!