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 1 Basic: Gasoline
Goal:
In this program, you will convert gallons of gasoline into several other measures. For this, we will use the
following conversions:
1 gallon =3.78541 liters
1 barrel of oil produces approximately 19.5 gallons of gasoline
FYI: That one barrel of oil is equivalent to 42 gallons
1 gallon of gasoline produces approximately 20 pounds of CO2 when burned
1 gallon of gasoline produces approximately 115,000BTU, while 1 gallon of ethanol produces
approximately 75,700 BTU
HINT: Set up a proportion to figure out how many gallons of ethanol is equivalent to 1
gallon of gasoline
1 gallon of gasoline costs $2.90
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 (3 decimal places)
How many barrels of oil are required to produce the gasoline (3 decimal places)
How many pounds of CO2 the gasoline produces when burned (3 decimal places)
How many gallons of ethanol is energy equivalent to the gasoline (2 decimal places)
How much the gasoline will cost at the pump (2 decimal places)
 Program 1 Basic: Gasoline Goal: In this program, you will convert

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!