Advertisement
Guest User

Untitled

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