Guest User

Untitled

a guest
Jun 13th, 2016
128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.89 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 _02SmallShop
  8. {
  9. class SmallShop
  10. {
  11. static void Main(string[] args)
  12. {
  13. string product = Console.ReadLine().ToLower();
  14. string town = Console.ReadLine().ToLower();
  15. double quantity = double.Parse(Console.ReadLine());
  16. double price = 0.0;
  17. if (town == "sofia")
  18. {
  19. switch (product)
  20. {
  21. case "coffee": price = quantity * 0.50; break;
  22. case "water": price = quantity * 0.80; break;
  23. case "beer": price = quantity * 1.20; break;
  24. case "sweets": price = quantity * 1.45; break;
  25. case "peanuts": price = quantity * 1.60; break;
  26. }
  27. }
  28. else if (town == "plovdiv")
  29. {
  30. switch (product)
  31. {
  32. case "coffee": price = quantity * 0.40; break;
  33. case "water": price = quantity * 0.70; break;
  34. case "beer": price = quantity * 1.15; break;
  35. case "sweets": price = quantity * 1.30; break;
  36. case "peanuts": price = quantity * 1.50; break;
  37. }
  38. }
  39. else if (town == "varna")
  40. {
  41. switch (product)
  42. {
  43. case "coffee": price = quantity * 0.45; break;
  44. case "water": price = quantity * 0.70; break;
  45. case "beer": price = quantity * 1.10; break;
  46. case "sweets": price = quantity * 1.35; break;
  47. case "peanuts": price = quantity * 1.55; break;
  48. }
  49. }
  50. Console.WriteLine(price);
  51. }
  52. }
  53. }
Add Comment
Please, Sign In to add comment