Advertisement
emona10

Untitled

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