WindFell

SmallShop

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