Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.39 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 SchoolCamp
  8. {
  9. class SchoolCamp
  10. {
  11. static void Main(string[] args)
  12. {
  13. var season = Console.ReadLine().ToLower();
  14. var type = Console.ReadLine().ToLower();
  15. var students = int.Parse(Console.ReadLine());
  16. var nights = int.Parse(Console.ReadLine());
  17.  
  18. var price = 0.0;
  19. var discount = 0;
  20. var price_final = 0.0;
  21.  
  22. if(students >= 50)
  23. {
  24. discount = 50;
  25. }
  26. else if(students >= 20 && students < 50)
  27. {
  28. discount = 15;
  29. }
  30. else if(students >= 10 && students < 20)
  31. {
  32. discount = 10;
  33. }
  34.  
  35.  
  36.  
  37. if (season == "winter")
  38. {
  39. if (type == "girls")
  40. {
  41. price = 9.60 * students * nights;
  42. if (students >= 10)
  43. {
  44. price_final = price - (price * discount) / 100;
  45. }
  46. else
  47. {
  48. price_final = price;
  49. }
  50. Console.WriteLine("Gymnastics {0:f2} lv.", price_final);
  51. }
  52. else if (type == "boys")
  53. {
  54. price = 9.60 * students * nights;
  55. if (students >= 10)
  56. {
  57. price_final = price - (price * discount) / 100;
  58. }
  59. else
  60. {
  61. price_final = price;
  62. }
  63. Console.WriteLine("Judo {0:f2} lv.", price_final);
  64. }
  65. else if (type == "mixed")
  66. {
  67. price = 10 * students * nights;
  68. if (students >= 10)
  69. {
  70. price_final = price - (price * discount) / 100;
  71. }
  72. else
  73. {
  74. price_final = price;
  75. }
  76. Console.WriteLine("Ski {0:f2} lv.", price_final);
  77. }
  78. }
  79. else if (season == "spring")
  80. {
  81. if (type == "girls")
  82. {
  83. price = 7.20 * students * nights;
  84. if (students >= 10)
  85. {
  86. price_final = price - (price * discount) / 100;
  87. }
  88. else
  89. {
  90. price_final = price;
  91. }
  92.  
  93. Console.WriteLine("Athletics {0:f2} lv.", price_final);
  94. }
  95. else if (type == "boys")
  96. {
  97. price = 7.20 * students * nights;
  98. if (students >= 10)
  99. {
  100. price_final = price - (price * discount) / 100;
  101. }
  102. else
  103. {
  104. price_final = price;
  105. }
  106.  
  107. Console.WriteLine("Tennis {0:f2} lv.", price_final);
  108. }
  109. else if (type == "mixed")
  110. {
  111. price = 9.50 * students * nights;
  112. if (students >= 10)
  113. {
  114. price_final = price - (price * discount) / 100;
  115. }
  116. else
  117. {
  118. price_final = price;
  119. }
  120. Console.WriteLine("Cycling {0:f2} lv.", price_final);
  121. }
  122. }
  123. else if(season == "summer")
  124. {
  125. if (type == "girls")
  126. {
  127. price = 15 * students * nights;
  128. if (students >= 10)
  129. {
  130. price_final = price - (price * discount) / 100;
  131. }
  132. else
  133. {
  134. price_final = price;
  135. }
  136. Console.WriteLine("Volleyball {0:f2} lv.", price_final);
  137. }
  138. else if (type == "boys")
  139. {
  140. price = 15 * students * nights;
  141. if (students >= 10)
  142. {
  143. price_final = price - (price * discount) / 100;
  144. }
  145. else
  146. {
  147. price_final = price;
  148. }
  149. Console.WriteLine("Football {0:f2} lv.", price_final);
  150. }
  151. else if (type == "mixed")
  152. {
  153. price = 20 * students * nights;
  154. if (students >= 10)
  155. {
  156. price_final = price - (price * discount) / 100;
  157. }
  158. else
  159. {
  160. price_final = price;
  161. }
  162. Console.WriteLine("Swimming {0:f2} lv.", price_final);
  163. }
  164. }
  165. }
  166. }
  167. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement