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 18:30
Which cultural aspect does this type of song best portray? a german polka dance
Answers: 1
question
Computers and Technology, 23.06.2019 04:31
Q14 what is most important for you to choose before you build a network? a. private network b. nos c. network media d. network protocol e. directory service
Answers: 1
question
Computers and Technology, 23.06.2019 09:30
Light travels at a speed of 186,000 miles a second. the distance light travels in a year is 5,865,690,000,000 miles/year 5,865,695,000,000 miles/year 58,656,950,000,000 miles/year 6,789,000,0000 miles/year
Answers: 1
question
Computers and Technology, 23.06.2019 13:30
Select the correct answer from each drop-down menu. which types of computer networks are bigger as well as smaller than a man? a man is a network of computers that covers an area bigger than a , but smaller than a .
Answers: 1
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, 18.03.2021 23:30
question
Mathematics, 18.03.2021 23:30
question
Mathematics, 18.03.2021 23:30
question
Mathematics, 18.03.2021 23:30
question
Mathematics, 18.03.2021 23:30
question
Social Studies, 18.03.2021 23:30