subject

Driving is expensive. Write a program with a car's miles/gallon (as float), gas dollars/gallon (as float), the number of miles to drive (as int) as input, compute the cost for the trip, and output the cost for the trip. Miles/gallon, dollars/gallon, and cost are to be printed using two decimal places. Note: if milespergallon, dollarspergallon, milestodrive, and trip_cost are the variables in the program then the output can be achieved using the print statement: print('Cost to drive {:d} miles at {:f} mpg at $ {:.2f}/gallon is: $ {:.2f}'.format(milestodrive, milespergallon, dollarspergallon, trip_cost)) Ex: If the input is: 21.34 3.15

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 00:30
At an open or uncontrolled intersection, yield if a. the cross road has more lanes than yours b. the cross road has fewer land than yours c. you’re on a state highway and the cross road is a secondary road d. do you have three or more passengers in your vehicle
Answers: 2
question
Computers and Technology, 22.06.2019 06:30
Requirement types discussed during software development include functional and color scheme nonfunctional and code style constraint and nonfunctional fashionable and functional.
Answers: 2
question
Computers and Technology, 22.06.2019 11:30
What do character formats do for your document's message? a.set the tone b.provide organization c.provide clarity d.set how texts align with documents
Answers: 2
question
Computers and Technology, 23.06.2019 12:00
What type of slide show is a dynamic and eye-catching way to familiarize potential customers with what your company has to offer? a. ole b. photo album c. brochure d. office clipboard
Answers: 2
You know the right answer?
Driving is expensive. Write a program with a car's miles/gallon (as float), gas dollars/gallon (as f...
Questions
question
Mathematics, 29.11.2021 01:00
question
Mathematics, 29.11.2021 01:00
question
Mathematics, 29.11.2021 01:00
question
Mathematics, 29.11.2021 01:00
question
Mathematics, 29.11.2021 01:00
Questions on the website: 13722362