Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

its python
image text in transcribed
image text in transcribed
image text in transcribed
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: + Due date: # . Author: # Input: + Output: # I pledge that I have completed the programming assignment independently. # I have not copied the code from a student or any source. # I have not given my code to any student. Sign here:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

12th edition

133544613, 978-0133544619

More Books

Students also viewed these Databases questions