Problem

Oil conversions and calculationsWrite a program that will prompt the user for a floating-p...

Oil conversions and calculations

Write a program that will prompt the user for a floating-point number that stands for gallons of gasoline. You will reprint that value along with other information about gasoline and gasoline usage:

• Number of liters

• Number of barrels of oil required to make this amount of gasoline

• Number of pounds of CO2 produced

• Equivalent energy amount of ethanol gallons

• Price in U.S. dollars

Here are some approximate conversion values:

• 1 barrel of oil produces 19.5 gallons of gasoline.

• 1 gallon of gasoline produces 20 pounds of CO2 gas when burned.

• 1 gallon of gasoline contains 115,000 BTU (British thermal units) of energy.

• 1 gallon of ethanol contains 75,700 BTU of energy.

• 1 gallon of gasoline costs $3.00/gallon.

Look on the Internet for some interesting values for input, such as the average number of gallons consumed per person per year, consumed by the country per day, or consumed per year.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
Solutions For Problems in Chapter 1
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT