MiroslavKisov

Small_Shop

Jul 26th, 2017
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 4.15 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 Small_Shop
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             string product = Console.ReadLine();
  14.             string city = Console.ReadLine();
  15.             double quantity = double.Parse(Console.ReadLine());
  16.             double coffeesofia = 0.50d;
  17.             double beersofia = 1.20d;
  18.             double sweetsofia = 1.45;
  19.             double watersofia = 0.80d;
  20.             double peanutssofia = 1.60;
  21.             double coffeeplovdiv = 0.40d;
  22.             double beerplovdiv = 1.15d;
  23.             double sweetplovdiv = 1.30;
  24.             double waterplovdim = 0.70d;
  25.             double peanutsplovdim = 1.50;
  26.             double coffeevarna = 0.45d;
  27.             double beervarna = 1.10d;
  28.             double sweetvarna = 1.35;
  29.             double watervarna = 0.70d;
  30.             double peanutsvarna = 1.55;
  31.             //coffee
  32.             if(product=="coffee")
  33.             {
  34.                 if(city=="Sofia")
  35.                 {
  36.                     double price = quantity * coffeesofia;
  37.                     Console.WriteLine(price);
  38.                 }
  39.                 else if(city=="Plovdiv")
  40.                 {
  41.                     double price = quantity * coffeeplovdiv;
  42.                     Console.WriteLine(price);
  43.                 }
  44.                 else if(city=="Varna")
  45.                 {
  46.                     double price = quantity * coffeevarna;
  47.                     Console.WriteLine(price);
  48.                 }
  49.             }
  50.             //water
  51.             if(product=="water")
  52.             {
  53.                 if(city=="Sofia")
  54.                 {
  55.                     double price = quantity * watersofia;
  56.                     Console.WriteLine(price);
  57.                 }
  58.                 else if (city == "Plovdiv")
  59.                 {
  60.                     double price = quantity * waterplovdim;
  61.                     Console.WriteLine(price);
  62.                 }
  63.                 else if (city == "Varna")
  64.                 {
  65.                     double price = quantity * watervarna;
  66.                     Console.WriteLine(price);
  67.                 }
  68.             }
  69.             //beer
  70.             if (product == "beer")
  71.             {
  72.                 if (city == "Sofia")
  73.                 {
  74.                     double price = quantity * beersofia;
  75.                     Console.WriteLine(price);
  76.                 }
  77.                 else if (city == "Plovdiv")
  78.                 {
  79.                     double price = quantity * beerplovdiv;
  80.                     Console.WriteLine(price);
  81.                 }
  82.                 else if (city == "Varna")
  83.                 {
  84.                     double price = quantity * beervarna;
  85.                     Console.WriteLine(price);
  86.                 }
  87.             }
  88.             //sweets
  89.             if (product == "sweets")
  90.             {
  91.                 if (city == "Sofia")
  92.                 {
  93.                     double price = quantity * sweetsofia;
  94.                     Console.WriteLine(price);
  95.                 }
  96.                 else if (city == "Plovdiv")
  97.                 {
  98.                     double price = quantity * sweetplovdiv;
  99.                     Console.WriteLine(price);
  100.                 }
  101.                 else if (city == "Varna")
  102.                 {
  103.                     double price = quantity * sweetvarna;
  104.                     Console.WriteLine(price);
  105.                 }
  106.             }
  107.             //peanuts
  108.             if (product == "peanuts")
  109.             {
  110.                 if (city == "Sofia")
  111.                 {
  112.                     double price = quantity * peanutssofia;
  113.                     Console.WriteLine(price);
  114.                 }
  115.                 else if (city == "Plovdiv")
  116.                 {
  117.                     double price = quantity * peanutsplovdim;
  118.                     Console.WriteLine(price);
  119.                 }
  120.                 else if (city == "Varna")
  121.                 {
  122.                     double price = quantity * peanutsvarna;
  123.                     Console.WriteLine(price);
  124.                 }
  125.             }
  126.         }
  127.     }
  128. }
Advertisement
Add Comment
Please, Sign In to add comment