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")
- {
- if (fuel == "Gas")
- {
- sum = 0.93;
- }
- else if (fuel == "Gasoline")
- {
- sum = 2.22;
- }
- else if (fuel == "Diesel")
- {
- sum = 2.33;
- }
- }
- else
- {
- if (fuel == "Gas")
- {
- sum = 0.85;
- }
- else if (fuel == "Gasoline")
- {
- sum = 2.04;
- }
- else if (fuel == "Diesel")
- {
- sum = 2.21;
- }
- }
- if (liter >= 20 && liter <= 25)
- {
- sum *= 0.92;
- }
- else if (liter > 25)
- {
- sum *= 0.9;
- }
- Console.WriteLine($"{sum * liter:F2} lv.");
- }
- }
- }
Add Comment
Please, Sign In to add comment