Advertisement
dsavov_02

nzbrat

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