Question: Program 1 Basic: Gasoline Goal: In this program, you will convert gallons of gasoline into several other measures. For this, we will use the following
Program Basic: Gasoline
Goal:
In this program, you will convert gallons of gasoline into several other measures. For this, we will use the
following conversions:
gallon liters
barrel of oil produces approximately gallons of gasoline
FYI: That one barrel of oil is equivalent to gallons
gallon of gasoline produces approximately pounds of when burned
gallon of gasoline produces approximately BTU, while gallon of ethanol produces
approximately BTU
HINT: Set up a proportion to figure out how many gallons of ethanol is equivalent to
gallon of gasoline
gallon of gasoline costs $
Specifications:
Ask the user "How many gallons of gasoline?" and accept the input as a float
Output the results of the conversions with the specified precision:
How many liters of gasoline this represents decimal places
How many barrels of oil are required to produce the gasoline decimal places
How many pounds of the gasoline produces when burned decimal places
How many gallons of ethanol is energy equivalent to the gasoline decimal places
How much the gasoline will cost at the pump decimal places
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
