Advertisement
VickSuna

Untitled

Feb 22nd, 2020
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _414_Small_Shop
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string product = Console.ReadLine();
  10. string city = Console.ReadLine();
  11. double quantity = double.Parse(Console.ReadLine());
  12.  
  13. double total = 0;
  14.  
  15. if (city == "Sofia")
  16. {
  17. if (product == "coffee")
  18. {
  19. total = quantity * 0.50;
  20. }
  21. else if (product == "water")
  22. {
  23. total = quantity * 0.80;
  24. }
  25. else if (product == "beer")
  26. {
  27. total = quantity * 1.20;
  28. }
  29. else if (product == "sweets")
  30. {
  31. total = quantity * 1.45;
  32. }
  33. else if (product == "peanuts")
  34. {
  35. total = quantity * 1.60;
  36. }
  37. }
  38. else if (city == "Plovdiv")
  39. {
  40. if (product == "coffee")
  41. {
  42. total = quantity * 0.40;
  43. }
  44. else if (product == "water")
  45. {
  46. total = quantity * 0.70;
  47. }
  48. else if (product == "beer")
  49. {
  50. total = quantity * 1.15;
  51. }
  52. else if (product == "sweets")
  53. {
  54. total = quantity * 1.30;
  55. }
  56. else if (product == "peanuts")
  57. {
  58. total = quantity * 1.50;
  59. }
  60. }
  61. else if (city == "Varna")
  62. {
  63. if (product == "coffee")
  64. {
  65. total = quantity * 0.45;
  66. }
  67. else if (product == "water")
  68. {
  69. total = quantity * 0.70;
  70. }
  71. else if (product == "beer")
  72. {
  73. total = quantity * 1.10;
  74. }
  75. else if (product == "sweets")
  76. {
  77. total = quantity * 1.35;
  78. }
  79. else if (product == "peanuts")
  80. {
  81. total = quantity * 1.55;
  82. }
  83.  
  84. }
  85.  
  86. Console.WriteLine(total);
  87.  
  88.  
  89.  
  90. }
  91. }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement