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

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
Code... View full answer
Get step-by-step solutions from verified subject matter experts
