Advertisement
Qrist

Small Shop

Apr 13th, 2020
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.64 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.    
  6.     static void Main(string[] args)
  7.     {
  8.         string product = Console.ReadLine();
  9.         string city = Console.ReadLine();
  10.         double quantity = double.Parse(Console.ReadLine());
  11.         double price = 0;
  12.         if(product=="coffee")
  13.         {
  14.             if(city=="Sofia")
  15.             {
  16.                 price = 0.50 * quantity;
  17.                 Console.WriteLine(price);
  18.             }
  19.             else if(city=="Plovdiv")
  20.             {
  21.                 price = 0.40 * quantity;
  22.                 Console.WriteLine(price);
  23.             }
  24.             else if(city=="Varna")
  25.             {
  26.                 price = 0.45 * quantity;
  27.                 Console.WriteLine(price);
  28.             }
  29.         }
  30.         else if(product=="water")
  31.         {
  32.             if (city == "Sofia")
  33.             {
  34.                 price = 0.80 * quantity;
  35.                 Console.WriteLine(price);
  36.             }
  37.             else if (city == "Plovdiv" || city=="Varna")
  38.             {
  39.                 price = 0.70 * quantity;
  40.                 Console.WriteLine(price);
  41.             }
  42.         }
  43.         else if(product=="beer")
  44.         {
  45.             if (city == "Sofia")
  46.             {
  47.                 price = 1.20 * quantity;
  48.                 Console.WriteLine(price);
  49.             }
  50.             else if (city == "Plovdiv")
  51.             {
  52.                 price = 1.15 * quantity;
  53.                 Console.WriteLine(price);
  54.             }
  55.             else if (city == "Varna")
  56.             {
  57.                 price = 1.10 * quantity;
  58.                 Console.WriteLine(price);
  59.             }
  60.         }
  61.         else if(product=="sweets")
  62.         {
  63.             if (city == "Sofia")
  64.             {
  65.                 price = 1.45 * quantity;
  66.                 Console.WriteLine(price);
  67.             }
  68.             else if (city == "Plovdiv")
  69.             {
  70.                 price = 1.30 * quantity;
  71.                 Console.WriteLine(price);
  72.             }
  73.             else if (city == "Varna")
  74.             {
  75.                 price = 1.35 * quantity;
  76.                 Console.WriteLine(price);
  77.             }
  78.         }
  79.         else if(product=="peanuts")
  80.         {
  81.             if (city == "Sofia")
  82.             {
  83.                 price = 1.60 * quantity;
  84.                 Console.WriteLine(price);
  85.             }
  86.             else if (city == "Plovdiv")
  87.             {
  88.                 price = 1.50 * quantity;
  89.                 Console.WriteLine(price);
  90.             }
  91.             else if (city == "Varna")
  92.             {
  93.                 price = 1.55 * quantity;
  94.                 Console.WriteLine(price);
  95.             }
  96.         }
  97.     }
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement