Page 1 of 1
Write a program that asks the user to enter the speed of a vehicle-in miles per hour, and the number of hours it has tra
Posted: Fri May 20, 2022 6:00 pm
by answerhappygod

- Write A Program That Asks The User To Enter The Speed Of A Vehicle In Miles Per Hour And The Number Of Hours It Has Tra 1 (47.41 KiB) Viewed 40 times

- Write A Program That Asks The User To Enter The Speed Of A Vehicle In Miles Per Hour And The Number Of Hours It Has Tra 2 (46.42 KiB) Viewed 40 times
Write a program that asks the user to enter the speed of a vehicle-in miles per hour, and the number of hours it has travelled. The program should then use a count-controlled loop to display the distance the vehicle has traveled for each hour of that period and the total distance traveled at the end of the period. Design: 1. Use two functions a. main function i. get user inputs: speed and hours II. call showTravel function b. showTravel 1. display header ii. display hour and distance travelled iii. display total distance traveled Required: Display and format the output as: C:\Python39\python.exe "I:/Class 32/Python 2022/Lab 11.2.py" May 12, 2022 @ 13:33:43 Enter the speed of the vehicle in mph: 60 Enter the number of hours traveled: 4 Hour Distance Traveled 1 2 3 60.00 120.00 180.00 240.00 4 The total distance travelled after 4 hours is 600.00 miles. Process finished with exit code o
Required 1. An illustrated flowchart 2. Two functions: main(), showTravell). 3. Parameters and arguments 4. A running total 5. A count-controlled loop 6. A range() function 7. f-String, format specifier 8. Local variables 9. Escape characters ( \t) 10. Use of the now() from the datetime module. 11. Formatted date and time using the strtime function. 12. Output aligned as shown in Sample Run 13. Add screenshot of source code.