anizko

02. Small Shop

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