Advertisement
M0Hk

SmallShop

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