Guest User

Untitled

a guest
Sep 21st, 2016
643
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.29 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 Shop
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             var product = Console.ReadLine().ToLower();
  15.             var town = Console.ReadLine().ToLower();
  16.             var quantity = double.Parse(Console.ReadLine());
  17.             var TotalPrice = 1d;
  18.  
  19.             if (town == "Sofia")
  20.             {
  21.                 if (product == "coffee")
  22.                 {
  23.                     TotalPrice = quantity * 0.50d;
  24.                 }
  25.                 else if (product == "water")
  26.                 {
  27.                     TotalPrice = quantity * 0.80d;
  28.                 }
  29.                 else if (product == "beer")
  30.                 {
  31.                     TotalPrice = quantity * 1.20d;
  32.                 }
  33.                 else if (product == "sweets")
  34.                 {
  35.                     TotalPrice = quantity * 1.45d;
  36.                 }
  37.                 else if (product == "peanuts")
  38.                 {
  39.                     TotalPrice = quantity * 1.60d;
  40.                 }
  41.  
  42.  
  43.  
  44.             }
  45.             if (town == "Povdiv")
  46.             {
  47.                 if (product == "coffee")
  48.                 {
  49.                     TotalPrice = quantity * 0.40d;
  50.                 }
  51.                 else if (product == "water")
  52.                 {
  53.                     TotalPrice = quantity * 0.70d;
  54.                 }
  55.                 else if (product == "beer")
  56.                 {
  57.                     TotalPrice = quantity * 1.15d;
  58.                 }
  59.                 else if (product == "sweets")
  60.                 {
  61.                     TotalPrice = quantity * 1.30d;
  62.                 }
  63.                 else if (product == "peanuts")
  64.                 {
  65.                     TotalPrice = quantity * 1.50d;
  66.                 }
  67.  
  68.  
  69.             }
  70.  
  71.  
  72.             if (town == "Varna")
  73.             {
  74.                 if (product == "coffee")
  75.                 {
  76.                     TotalPrice = quantity * 0.45d;
  77.                 }
  78.                 else if (product == "water")
  79.                 {
  80.                     TotalPrice = quantity * 0.70d;
  81.                 }
  82.                 else if (product == "beer")
  83.                 {
  84.                     TotalPrice = quantity * 1.10d;
  85.                 }
  86.                 else if (product == "sweets")
  87.                 {
  88.                     TotalPrice = quantity * 1.35d;
  89.                 }
  90.                 else if (product == "peanuts")
  91.                 {
  92.                     TotalPrice = quantity * 1.55d;
  93.                 }
  94.             }
  95.  
  96.             Console.WriteLine(Math.Round(TotalPrice, (3)));
  97.  
  98.  
  99.         }
  100.  
  101.     }
  102. }
Advertisement
Add Comment
Please, Sign In to add comment