Question: write this program Al's Last Chance Gas station sits on Route 190 on the edge of Death Valley. There is no other gas station for

Al's Last Chance Gas station sits on Route 190 on the edge of Death Valley. There is no other gas station for 200 kilometers. You are to write a program to help drivers decide if they need gas or if it is safe to carry on. The program asks for: The capacity of the gas tank in liters a double value. The car's mileage (kilometers per liter) a double value An integer value for determining the amount of gas currently in the gas tank as follows: (100- gas tank is full, 75 - the gas tank is three quarters full, 50 - the gas tank is half full, 25- the gas tank is quarter full and 0 - if the gas tank is almost empty). Based on what the user's input above, the program then writes out "Get Gas" or "Safe to Proceed" depending on if the car can travel the 200 kilometers with the gas remaining in the tank. Sample Run: Enter Your tank capacity in liters: 12 Enter Your car's mileage (kilometers per liter): 30 Enter Gas remaining in tank as a percent: 50 Distance the car will travel before it runs out of gas is: 180 km. >>>> YOU SHOULD GET GAS < <
Step by Step Solution
3.57 Rating (150 Votes )
There are 3 Steps involved in it
C program to input the tank capacity car mileage and current gas remaining and display a message bas... View full answer
Get step-by-step solutions from verified subject matter experts
