Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2. Four countries in the world do not officially use the metric system: the United States, the United Kingdom, Liberia, and Myanmar. Even in

image

2. Four countries in the world do not officially use the metric system: the United States, the United Kingdom, Liberia, and Myanmar. Even in the United States, the practice is that some industries are almost completely metric, and others still use the English system of units. Confusion between metric and English units is common. American travelers to Canada are regularly confused because gasoline is sold by the liter in Canada, but by the gallon in the United States. Let's write a program using if/else structure that can be used to buy gasoline in metric system or English system of units. Write a program that: Asks the user whether he or she wants to request the gasoline in liters or in gallons. Use the characters / for liters and g for gallons. Prompts the user to enter how much gas he or she wants to buy. . Calculates the total cost to the user, if gasoline costs $3.89 per gallon. Assume 1 liter = 0.264 gallons . Submit a screenshot for both cases with your code. Copy all screenshots to a word doc and make a single printout.

Step by Step Solution

3.43 Rating (150 Votes )

There are 3 Steps involved in it

Step: 1

Code... 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

Macroeconomics Principles Applications And Tools

Authors: Arthur O Sullivan, Steven M. Sheffrin, Stephen J. Perez

7th Edition

978-0134089034, 9780134062754, 134089030, 134062752, 978-0132555234

More Books

Students also viewed these Electrical Engineering questions

Question

differentiate the function ( x + 1 ) / ( x ^ 3 + x - 6 )

Answered: 1 week ago