Advertisement
Guest User

Untitled

a guest
Jul 31st, 2014
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.81 KB | None | 0 0
  1. namespace benzin
  2. {
  3.     class Program
  4.     {
  5.         static void Main(string[] args)
  6.         {
  7.             double Price;
  8.            
  9.             Console.WriteLine("Введите объем");
  10.             int Oil = int.Parse(Console.ReadLine());
  11.             Console.WriteLine("Марка бензина");
  12.             string Type = Console.ReadLine();
  13.            Console.WriteLine("Есть карта? Скидка 10% Y or N");
  14.            
  15.             string input = Console.ReadLine();
  16.             bool case1 = input.Contains("Y");
  17.             bool case2 = input.Contains("N");
  18.            
  19.              
  20.            
  21.                 if (case1)
  22.            
  23.                 if (Type == "92")
  24.                 {
  25.                     Price = Oil * 30.92;
  26.                     Console.Write(Price);
  27.                 }
  28.  
  29.                 if (Type == "95")
  30.                 {
  31.                     Price = Oil * 32.77;
  32.                     Console.Write(Price);
  33.                 }
  34.  
  35.                 if (Type == "98")
  36.                 {
  37.                     Price = Oil * 36.34;
  38.                     Console.Write(Price);
  39.                 }
  40.            
  41.  
  42.             else
  43.                 {
  44.                     if (Type == "92")
  45.                 {
  46.                     Price = ((Oil * 30.92) - (Oil * 30.92)*0.1) ;
  47.                     Console.Write(Price);
  48.                 }
  49.  
  50.                 if (Type == "95")
  51.                 {
  52.                     Price = ((Oil * 32.77) - (Oil * 32.77)*0.1);
  53.                     Console.Write(Price);
  54.                 }
  55.  
  56.                 if (Type == "98")
  57.                 {
  58.                     Price =  - ((Oil * 36.34) -(Oil * 36.34)*0.1);
  59.                     Console.Write(Price);
  60.                 }
  61.  
  62.  
  63.  
  64.                 }
  65.  
  66.             Console.ReadLine();
  67.         }
  68.     }
  69. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement