Advertisement
Guest User

Small Shop

a guest
Oct 29th, 2017
153
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 _02.SmallShop
  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.             if (town == "Sofia")
  17.             {
  18.                 if (product == "coffee") Console.WriteLine(0.50 * quantity);
  19.                 if (product == "water") Console.WriteLine(0.80 * quantity);
  20.                 if (product == "beer") Console.WriteLine(1.20 * quantity);
  21.                 if (product == "sweets") Console.WriteLine(1.45 * quantity);
  22.                 if (product == "peanuts") Console.WriteLine(1.60 * quantity);
  23.             }
  24.             if (town == "Plovdiv")
  25.             {
  26.                 if (product == "coffee") Console.WriteLine(0.40 * quantity);
  27.                 if (product == "water") Console.WriteLine(0.70 * quantity);
  28.                 if (product == "beer") Console.WriteLine(1.15 * quantity);
  29.                 if (product == "sweets") Console.WriteLine(1.30 * quantity);
  30.                 if (product == "peanuts") Console.WriteLine(1.50 * quantity);
  31.             }
  32.             if (town == "Varna")
  33.             {
  34.                 if (product == "coffee") Console.WriteLine(0.45 * quantity);
  35.                 if (product == "water") Console.WriteLine(0.70 * quantity);
  36.                 if (product == "beer") Console.WriteLine(1.10 * quantity);
  37.                 if (product == "sweets") Console.WriteLine(1.35 * quantity);
  38.                 if (product == "peanuts") Console.WriteLine(1.55 * quantity);
  39.             }
  40.         }
  41.     }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement