Answered step by step
Verified Expert Solution
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
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...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started