Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace FuelTank2
- {
- class Program
- {
- static void Main(string[] args)
- {
- string fuel = Console.ReadLine();
- double liter = double.Parse(Console.ReadLine());
- string cart = Console.ReadLine();
- double sum = 0;
- if (cart == "No")
- {
- switch (fuel)
- {
- case "Gas":
- sum = 0.93;
- break;
- case "Gasoline":
- sum = 2.22;
- break;
- case "Diesel":
- sum = 2.33;
- break;
- }
- }
- else
- {
- switch (fuel)
- {
- case "Gas":
- sum = 0.85;
- break;
- case "Gasoline":
- sum = 2.04;
- break;
- case "Diesel":
- sum = 2.21;
- break;
- }
- }
- if (liter >= 20 && liter <= 25)
- {
- sum = 0.92 * sum;
- }
- else if (liter > 25)
- {
- sum = 0.9 * sum;
- }
- Console.WriteLine($"{sum * liter:F2} lv.");
- }
- }
- }
Add Comment
Please, Sign In to add comment