Advertisement
ad2bg

SmallShop

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