Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+herself to in terms of equity with regard to this assignment?

Answered: 1 week ago

Question

=+ What typical employee will the IA compare him/

Answered: 1 week ago

Question

=+7 What is the overall cost of the international assignment?

Answered: 1 week ago