nvnnaidenov

SmallShop - Chapter 4.0

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