Advertisement
koksibg

Small_Shop

Jul 1st, 2016
947
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.74 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Small_Shop
  8. {
  9.     class Small_Shop
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             var product = Console.ReadLine().ToLower();
  14.             var town = Console.ReadLine().ToLower();
  15.             var quantity = double.Parse(Console.ReadLine());
  16.             if (town == "sofia")
  17.             {   if (product == "coffee")   Console.WriteLine(0.5 * quantity);
  18.                 if (product == "water")   Console.WriteLine(0.8 * quantity);
  19.                 if (product == "beer")    Console.WriteLine(1.2 * quantity);
  20.                 if (product == "sweets")  Console.WriteLine(1.45 * quantity);
  21.                 if (product == "peanuts") Console.WriteLine(1.6 * quantity);
  22.             }
  23.             if (town == "varna")
  24.             {
  25.                 if (product == "coffee") Console.WriteLine(0.45 * quantity);
  26.                 if (product == "water") Console.WriteLine(0.7 * quantity);
  27.                 if (product == "beer") Console.WriteLine(1.1 * quantity);
  28.                 if (product == "sweets") Console.WriteLine(1.35 * quantity);
  29.                 if (product == "peanuts") Console.WriteLine(1.55 * quantity);
  30.             }
  31.             if (town == "plovdiv")
  32.             {
  33.                 if (product == "coffee")   Console.WriteLine(0.4 * quantity);
  34.                 if (product == "water")   Console.WriteLine(0.7 * quantity);
  35.                 if (product == "beer")    Console.WriteLine(1.15 * quantity);
  36.                 if (product == "sweets")  Console.WriteLine(1.3 * quantity);
  37.                 if (product == "peanuts") Console.WriteLine(1.5 * quantity);
  38.             }
  39.            
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement