Advertisement
nevenailievaa

05.SmallShop

Oct 18th, 2022
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.15 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _05.SmallShop
  4. {
  5.     internal class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //input
  10.             string inputProduct = Console.ReadLine();
  11.             string city = Console.ReadLine();
  12.             double amount = double.Parse(Console.ReadLine());
  13.             double price = 0;
  14.  
  15.             //action
  16.             if (city == "Sofia")
  17.             {
  18.                 if (inputProduct == "coffee")
  19.                 {
  20.                     price = amount * 0.50;
  21.                     Console.WriteLine(price);
  22.                 }
  23.                 if (inputProduct == "water")
  24.                 {
  25.                     price = amount * 0.80;
  26.                     Console.WriteLine(price);
  27.                 }
  28.                 if (inputProduct == "beer")
  29.                 {
  30.                     price = amount * 1.20;
  31.                     Console.WriteLine(price);
  32.                 }
  33.                 if (inputProduct == "sweets")
  34.                 {
  35.                     price = amount * 1.45;
  36.                     Console.WriteLine(price);
  37.                 }
  38.                 if (inputProduct == "peanuts")
  39.                 {
  40.                     price = amount * 1.60;
  41.                     Console.WriteLine(price);
  42.                 }
  43.             }
  44.  
  45.             if (city == "Plovdiv")
  46.             {
  47.                 if (inputProduct == "coffee")
  48.                 {
  49.                     price = amount * 0.40;
  50.                     Console.WriteLine(price);
  51.                 }
  52.                 if (inputProduct == "water")
  53.                 {
  54.                     price = amount * 0.70;
  55.                     Console.WriteLine(price);
  56.                 }
  57.                 if (inputProduct == "beer")
  58.                 {
  59.                     price = amount * 1.15;
  60.                     Console.WriteLine(price);
  61.                 }
  62.                 if (inputProduct == "sweets")
  63.                 {
  64.                     price = amount * 1.30;
  65.                     Console.WriteLine(price);
  66.                 }
  67.                 if (inputProduct == "peanuts")
  68.                 {
  69.                     price = amount * 1.50;
  70.                     Console.WriteLine(price);
  71.                 }
  72.             }
  73.  
  74.             if (city == "Varna")
  75.             {
  76.                 if (inputProduct == "coffee")
  77.                 {
  78.                     price = amount * 0.45;
  79.                     Console.WriteLine(price);
  80.                 }
  81.                 if (inputProduct == "water")
  82.                 {
  83.                     price = amount * 0.70;
  84.                     Console.WriteLine(price);
  85.                 }
  86.                 if (inputProduct == "beer")
  87.                 {
  88.                     price = amount * 1.10;
  89.                     Console.WriteLine(price);
  90.                 }
  91.                 if (inputProduct == "sweets")
  92.                 {
  93.                     price = amount * 1.35;
  94.                     Console.WriteLine(price);
  95.                 }
  96.                 if (inputProduct == "peanuts")
  97.                 {
  98.                     price = amount * 1.55;
  99.                     Console.WriteLine(price);
  100.                 }
  101.             }
  102.         }
  103.     }
  104. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement