bacco

Квартално магазинче

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