Question: Please write in Python 3 Bill and Ted are taking a road trip. But the odometer in their car is broken, so they don't know

Please write in Python 3

Please write in Python 3 Bill and Ted are taking a road

Bill and Ted are taking a road trip. But the odometer in their car is broken, so they don't know how many miles they have driven. Fortunately, Bill has a working stopwatch, so they can record their speed and the total time they have driven. Unfortunatelv, their record keeping strategy is a little odd. so thev need help computing the total distance driven. You are to write a program to do this computation For example, if their log shows per hour Total elapsed 2 Speed in miles 20 30 10 time in hours 7 this means they drove 2 hours at 20 miles per hour, then 6-2-4 hours at 30 miles per hour, then 7-6-1 hour at 10 miles per hour. The distance driven is then (2) (20) + (4)(30) + (1)(10) 40120 10 170 miles. Note that the total elapsed time is alwavs since the beginning of the trip, not since the previous entrv in their log. Input Each line of the input will consist of two values: the speed (in miles per hour) and a timestamp (in hours). The input will end with a line that says "Done". Note all of the speeds and times will be positive integers Output The output should the the total distance driven with units, for example 180 miles Example sessions 20 2 30 6 10 7 Done 170 miles

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!