Advertisement
Guest User

SmallShop

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