question The distance a vehicle travels can be calculated as follows: Distance =
ID: 441565 • Letter: Q
Question
question The distance a vehicle travels can be calculated as follows: Distance = Speed * Time For example, if a train travels 40 miles-per-hour (MPH) for three hours, the distance traveled is 120 miles (40 MPH * 3 hours = 120 miles). Write a program that asks the user for the speed of a vehicle (in miles-per-hour) and the number of hours it has traveled. It should use a loop to display the distance a vehicle has traveled for each hour of a time period specified by the user. Assumption: You may assume that the user will enter positive integer values for both the time and the distance. Here is a sample run (user input is given in <>): Please enter the vehicleExplanation / Answer
Hi,
If i understand your question correctly, Below is the explanation
For the below input:
Please enter the vehicle
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.