grach

SmallShop

Jul 11th, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.06 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 Program
  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.  
  17.             if (town == "sofia")
  18.             {
  19.                 if (product == "coffee")
  20.                     Console.WriteLine(0.50 * quantity);
  21.                 if (product == "water")
  22.                     Console.WriteLine(0.80 * quantity);
  23.                 if (product == "beer")
  24.                     Console.WriteLine(1.20 * quantity);
  25.                 if (product == "sweets")
  26.                     Console.WriteLine(1.45 * quantity);
  27.                 if (product == "peanuts")
  28.                     Console.WriteLine(1.60 * quantity);
  29.             }
  30.             if (town == "varna")
  31.             {
  32.                 if (product == "coffee")
  33.                     Console.WriteLine(0.45 * quantity);
  34.                 if (product == "water")
  35.                     Console.WriteLine(0.70 * quantity);
  36.                 if (product == "beer")
  37.                     Console.WriteLine(1.10 * quantity);
  38.                 if (product == "sweets")
  39.                     Console.WriteLine(1.35 * quantity);
  40.                 if (product == "peanuts")
  41.                     Console.WriteLine(1.55 * quantity);
  42.             }
  43.  
  44.             if (town == "plovdiv")
  45.  
  46.             {
  47.                 if (product == "coffee")
  48.                     Console.WriteLine(0.40 * quantity);
  49.                 if (product == "water")
  50.                     Console.WriteLine(0.70 * quantity);
  51.                 if (product == "beer")
  52.                     Console.WriteLine(1.15 * quantity);
  53.                 if (product == "sweets")
  54.                     Console.WriteLine(1.30 * quantity);
  55.                 if (product == "peanuts")
  56.                     Console.WriteLine(1.50 * quantity);
  57.             }
  58.            
  59.         }
  60.     }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment