NedyalkoKikov

SmallShop

Jun 5th, 2016
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.02 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 SmallShop
  8. {
  9. class SmallShop
  10. {
  11. static void Main(string[] args)
  12. {
  13. string product = Console.ReadLine();
  14. string town = Console.ReadLine();
  15.  
  16. double quantity = 0;
  17. double price = 0;
  18. if (town.Equals("Sofia"))
  19. {
  20. if (product.Equals("coffee"))
  21. {
  22. quantity = double.Parse(Console.ReadLine());
  23. price += 0.50;
  24. double priceOfCaffe = quantity * price;
  25. Console.WriteLine(priceOfCaffe);
  26. }
  27. else if (product.Equals("water"))
  28. {
  29. quantity = double.Parse(Console.ReadLine());
  30. price += 0.80;
  31. double priceOfWater = quantity * price;
  32. Console.WriteLine(priceOfWater);
  33. }
  34. else if (product.Equals("beer"))
  35. {
  36. quantity = double.Parse(Console.ReadLine());
  37. price += 1.20;
  38. double priceOfBeer = quantity * price;
  39. Console.WriteLine(priceOfBeer);
  40. }
  41. else if (product.Equals("sweets"))
  42. {
  43. quantity = double.Parse(Console.ReadLine());
  44. price += 1.45;
  45. double priceOfSweets = quantity * price;
  46. Console.WriteLine(priceOfSweets);
  47. }
  48. else
  49. {
  50. quantity = double.Parse(Console.ReadLine());
  51. price += 1.60;
  52. double priceOfPeanuts = quantity * price;
  53. Console.WriteLine(priceOfPeanuts);
  54. }
  55. }
  56. if(town.Equals("Plovdiv"))
  57. {
  58. if(product.Equals("coffee"))
  59. {
  60. quantity = double.Parse(Console.ReadLine());
  61. price += 0.40;
  62. double priceOfcoffee = quantity * price;
  63. Console.WriteLine(priceOfcoffee);
  64. }
  65. else if(product.Equals("water"))
  66. {
  67. quantity = double.Parse(Console.ReadLine());
  68. price += 0.70;
  69. double priceOfWater = quantity * price;
  70. Console.WriteLine(priceOfWater);
  71. }
  72. else if(product.Equals("beer"))
  73. {
  74. quantity = double.Parse(Console.ReadLine());
  75. price += 1.15;
  76. double priceOfbeer = quantity * price;
  77. Console.WriteLine(priceOfbeer);
  78. }
  79. else if(product.Equals("sweets"))
  80. {
  81. quantity = double.Parse(Console.ReadLine());
  82. price += 1.30;
  83. double priceOfSweets = quantity * price;
  84. Console.WriteLine(priceOfSweets);
  85. }
  86. else
  87. {
  88. quantity = double.Parse(Console.ReadLine());
  89. price += 1.50;
  90. double priceOfPeanuts = quantity * price;
  91. Console.WriteLine(priceOfPeanuts);
  92. }
  93. }
  94. if(town.Equals("Varna"))
  95. {
  96. if(product.Equals("coffee"))
  97. {
  98. quantity = double.Parse(Console.ReadLine());
  99. price += 0.45;
  100. double priceOfCoffee = quantity * price;
  101. Console.WriteLine(priceOfCoffee);
  102. }
  103. else if(product.Equals("water"))
  104. {
  105. quantity = double.Parse(Console.ReadLine());
  106. price += 0.70;
  107. double priceOfWater = quantity * price;
  108. Console.WriteLine(priceOfWater);
  109. }
  110. else if(product.Equals("beer"))
  111. {
  112. quantity = double.Parse(Console.ReadLine());
  113. price += 1.10;
  114. double priceOfBeer = quantity * price;
  115. Console.WriteLine(priceOfBeer);
  116. }
  117. else if(product.Equals("sweets"))
  118. {
  119. quantity = double.Parse(Console.ReadLine());
  120. price += 1.35;
  121. double priceOfSweets = quantity * price;
  122. Console.WriteLine(priceOfSweets);
  123. }
  124. else
  125. {
  126. quantity = double.Parse(Console.ReadLine());
  127. price += 1.55;
  128. double priceOfPeanuts = quantity * price;
  129. Console.WriteLine(priceOfPeanuts);
  130.  
  131. }
  132. }
  133. }
  134. }
  135. }
Add Comment
Please, Sign In to add comment