Python 3

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Python 3

Post by answerhappygod »

Python 3
Python 3 1
Python 3 1 (51.82 KiB) Viewed 9 times
2. Ask the user for the speed in miles per hour, hours traveled (should be an integer), miles per gallon your vehicle gets, and price of gas per gallon. 3. Using a while loop, output for each hour the distance traveled, gallons of gas used, and cost so far (see example below). 4. Your output should be in the format of the example, with two decimal places, spacing, etc. (User input in red). You may need to use multiple back-to-back tabs in your output to get the correct alignment. 5. You can use any method of formatting you want, as long as it matches the example. Speed in miles per hour: 40 Hours traveled: 3 Miles per gallon: 23 Price of gas per gallon: 2.19 Gallons Hour 1 2 3 Distance 40 80 120 1.74 3.48 5.22 Cost $3.81 $7.62 $11.43
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply