Advertisement
Guest User

Untitled

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