Anzzhhela98

dd

Jun 19th, 2020
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Резервоар_за_гориво2
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             string type = Console.ReadLine();
  10.             int quantityType = int.Parse(Console.ReadLine());
  11.             string card = Console.ReadLine();
  12.             double price = 0;
  13.             if (type == "Gas")
  14.             {
  15.                 price = quantityType * 0.93;
  16.                 if (card == "Yes")
  17.                 {
  18.                     price = quantityType * 0.85;
  19.                 }
  20.             }
  21.             else if (type == "Gasoline")
  22.             {
  23.                 price = quantityType * 2.22;
  24.  
  25.                 if (card == "Yes")
  26.                 {
  27.                     price = quantityType * 2.04;
  28.                 }
  29.  
  30.             }
  31.             else if (type == "Diesel")
  32.             {
  33.                 price = quantityType * 2.33;
  34.                 if (card == "Yes")
  35.                 {
  36.                     price = quantityType * 2.11;
  37.                 }
  38.  
  39.             }
  40.             if (quantityType >= 20 && quantityType <= 25)
  41.             {
  42.                 price = price - (price * 0.08);
  43.             }
  44.             if (quantityType > 25)
  45.             {
  46.                 price = price - (price * 0.1);
  47.             }
  48.             Console.WriteLine($"{price:f2} lv.");
  49.         }
  50.     }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment