|Write a program to assist in monitoring the gasoline supply in a refinery storage tank. Your program should alert the supervisor when the supply of gasoline in the tank falls below 10% of the tank’s 80,000-barrel storage capacity. The supervisor is accustomed to dealing with the contents of the tank in terms of a number of barrels. However, the pump used to fill tanker trucks gives its measurements in gallons, so your program will need to do the necessary conversions. The petroleum industry’s barrel equals 42 US gallons. The program should first request that the operator enter the amount of gasoline currently in the tank. Then prompt the user to input the number of gallons pumped into a tanker and update the number of barrels still available. When the supply drops below the 10% limit, issue a warning and end the program. |
Number of barrels currently in tank => 8500.5
8500.50 barrels are available.
Enter number of gallons removed => 5859.0
After removal of 5859.00 gallons (139.50 barrels)
8361.00 barrels are available.
Enter number of gallons removed => 7568.4
After removal of 7568.40 gallons (180.20 barrels)
8180.80 barrels are available.
Enter number of gallons removed => 8400.0
After removal of 8400.00 gallons (200.00 barrels)
7980.80 barrels are available.
**** WARNING ***
Available supply is less than 10% of tank’s 80000.00 barrel capacity