Question: its python If we want to calculate the distance a vehicle travels, we can use this formula distance = speed x time Write a program


If we want to calculate the distance a vehicle travels, we can use this formula distance = speed x time Write a program that a) Ask the user for the speed of the car (in km per hour) b) Ask the user for the number of hours the car has traveled Use a loop to calculate the distance the car has traveled for each hour of that time period. -----sample run 1 ---- The speed of the car in km per hour: 65 The number of hours the car has traveled: 4 Hour Distance traveled 65 1 2 130 3 195 260 ---sample run 1 The speed of the car in km per hour: 62 The number of hours the car has traveled: 3 Hour Distance traveled 62 124 Hour Distance traveled 1 65 2 130 3 195 4 260 ----sample run 1 The speed of the car in km per hour: 62 The number of hours the car has traveled: 3 Hour Distance traveled 1 62 2 124 3 186 Deliverable: Upload the Python source file with filename main.py to space under this question. Use the following as the header of each python source file. You need to replace the text in "*". 3 186 Deliverable: Upload the Python source file with filename main.py to space under this question. Use the following as the header of each python source file. You need to replace the text in ">". # Course: CMPT 140 Introduction to Computing Science and Programming I # Instructor: Dr. Herbert H. Tsang # Description:
Step by Step Solution
There are 3 Steps involved in it
To implement the program as described you can write a Python script like the following Make sure to ... View full answer
Get step-by-step solutions from verified subject matter experts
