aneliabogeva

Untitled

Apr 4th, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.77 KB | None | 0 0
  1. using System;
  2.  
  3. namespace PasswordGenerator
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string typeOfSushi = Console.ReadLine();
  10. string nameOfRestorant = Console.ReadLine();
  11. int numberOfPieces = int.Parse(Console.ReadLine());
  12. string order = Console.ReadLine();
  13.  
  14. switch (typeOfSushi)
  15. {
  16. case "sashimi":
  17. if (nameOfRestorant == "Sushi Zone")
  18. {
  19. double price = numberOfPieces * 4.99;
  20. if (order == "Y")
  21. {
  22. double totalPrice = Math.Ceiling(price * 0.20 + price);
  23. Console.WriteLine($"Total price: {totalPrice} lv.");
  24. }
  25. else
  26. {
  27. double totalPrice = Math.Ceiling(price);
  28. Console.WriteLine($"Total price: {totalPrice} lv.");
  29. }
  30. }
  31. else if (nameOfRestorant == "Sushi Time")
  32. {
  33. double price = numberOfPieces * 5.49;
  34. if (order == "Y")
  35. {
  36. double totalPrice = Math.Ceiling(price * 0.20 + price);
  37. Console.WriteLine($"Total price: {totalPrice} lv.");
  38. }
  39. else
  40. {
  41. double totalPrice = Math.Ceiling(price);
  42. Console.WriteLine($"Total price: {totalPrice} lv.");
  43. }
  44. }
  45. else if (nameOfRestorant == "Sushi Bar")
  46. {
  47. double price = numberOfPieces * 5.25;
  48. if (order == "Y")
  49. {
  50. double totalPrice = Math.Ceiling(price * 0.20 + price);
  51. Console.WriteLine($"Total price: {totalPrice} lv.");
  52. }
  53. else
  54. {
  55. double totalPrice = Math.Ceiling(price);
  56. Console.WriteLine($"Total price: {totalPrice} lv.");
  57. }
  58. }
  59. else if (nameOfRestorant == "Asian Pub")
  60. {
  61. double price = numberOfPieces * 4.99;
  62. if (order == "Y")
  63. {
  64. double totalPrice = Math.Ceiling(price * 0.20 + price);
  65. Console.WriteLine($"Total price: {totalPrice} lv.");
  66. }
  67. else
  68. {
  69. double totalPrice = Math.Ceiling(price);
  70. Console.WriteLine($"Total price: {totalPrice} lv.");
  71. }
  72. }
  73. else
  74. {
  75. Console.WriteLine($"{nameOfRestorant} is invalid restaurant!");
  76. }
  77.  
  78. break;
  79. case "maki":
  80. if (nameOfRestorant == "Sushi Zone")
  81. {
  82. double price = numberOfPieces * 5.29;
  83. if (order == "Y")
  84. {
  85. double totalPrice = Math.Ceiling(price * 0.20 + price);
  86. Console.WriteLine($"Total price: {totalPrice} lv.");
  87. }
  88. else
  89. {
  90. double totalPrice = Math.Ceiling(price);
  91. Console.WriteLine($"Total price: {totalPrice} lv.");
  92. }
  93. }
  94. else if (nameOfRestorant == "Sushi Time")
  95. {
  96. double price = numberOfPieces * 4.69;
  97. if (order == "Y")
  98. {
  99. double totalPrice = Math.Ceiling(price * 0.20 + price);
  100. Console.WriteLine($"Total price: {totalPrice} lv.");
  101. }
  102. else
  103. {
  104. double totalPrice = Math.Ceiling(price);
  105. Console.WriteLine($"Total price: {totalPrice} lv.");
  106. }
  107. }
  108. else if (nameOfRestorant == "Sushi Bar")
  109. {
  110. double price = numberOfPieces * 5.55;
  111. if (order == "Y")
  112. {
  113. double totalPrice = Math.Ceiling(price * 0.20 + price);
  114. Console.WriteLine($"Total price: {totalPrice} lv.");
  115. }
  116. else
  117. {
  118. double totalPrice = Math.Ceiling(price);
  119. Console.WriteLine($"Total price: {totalPrice} lv.");
  120. }
  121. }
  122. else if (nameOfRestorant == "Asian Pub")
  123. {
  124. double price = numberOfPieces * 4.80;
  125. if (order == "Y")
  126. {
  127. double totalPrice = Math.Ceiling(price * 0.20 + price);
  128. Console.WriteLine($"Total price: {totalPrice} lv.");
  129. }
  130. else
  131. {
  132. double totalPrice = Math.Ceiling(price);
  133. Console.WriteLine($"Total price: {totalPrice} lv.");
  134. }
  135. }
  136. else
  137. {
  138. Console.WriteLine($"{nameOfRestorant} is invalid restaurant!");
  139. }
  140.  
  141. break;
  142. case "uramaki":
  143. if (nameOfRestorant == "Sushi Zone")
  144. {
  145. double price = numberOfPieces * 5.99;
  146. if (order == "Y")
  147. {
  148. double totalPrice = Math.Ceiling(price * 0.20 + price);
  149. Console.WriteLine($"Total price: {totalPrice} lv.");
  150. }
  151. else
  152. {
  153. double totalPrice = Math.Ceiling(price);
  154. Console.WriteLine($"Total price: {totalPrice} lv.");
  155. }
  156. }
  157. else if (nameOfRestorant == "Sushi Time")
  158. {
  159. double price = numberOfPieces * 4.49;
  160. if (order == "Y")
  161. {
  162. double totalPrice = Math.Ceiling(price * 0.20 + price);
  163. Console.WriteLine($"Total price: {totalPrice} lv.");
  164. }
  165. else
  166. {
  167. double totalPrice = Math.Ceiling(price);
  168. Console.WriteLine($"Total price: {totalPrice} lv.");
  169. }
  170. }
  171. else if (nameOfRestorant == "Sushi Bar")
  172. {
  173. double price = numberOfPieces * 6.25;
  174. if (order == "Y")
  175. {
  176. double totalPrice = Math.Ceiling(price * 0.20 + price);
  177. Console.WriteLine($"Total price: {totalPrice} lv.");
  178. }
  179. else
  180. {
  181. double totalPrice = Math.Ceiling(price);
  182. Console.WriteLine($"Total price: {totalPrice} lv.");
  183. }
  184. }
  185. else if (nameOfRestorant == "Asian Pub")
  186. {
  187. double price = numberOfPieces * 5.50;
  188. if (order == "Y")
  189. {
  190. double totalPrice = Math.Ceiling(price * 0.20 + price);
  191. Console.WriteLine($"Total price: {totalPrice} lv.");
  192. }
  193. else
  194. {
  195. double totalPrice = Math.Ceiling(price);
  196. Console.WriteLine($"Total price: {totalPrice} lv.");
  197. }
  198. }
  199. else
  200. {
  201. Console.WriteLine($"{nameOfRestorant} is invalid restaurant!");
  202. }
  203.  
  204.  
  205. break;
  206. case "temaki":
  207. if (nameOfRestorant == "Sushi Zone")
  208. {
  209. double price = numberOfPieces * 4.29;
  210. if (order == "Y")
  211. {
  212. double totalPrice = Math.Ceiling(price * 0.20 + price);
  213. Console.WriteLine($"Total price: {totalPrice} lv.");
  214. }
  215. else
  216. {
  217. double totalPrice = Math.Ceiling(price);
  218. Console.WriteLine($"Total price: {totalPrice} lv.");
  219. }
  220. }
  221. else if (nameOfRestorant == "Sushi Time")
  222. {
  223. double price = numberOfPieces * 5.19;
  224. if (order == "Y")
  225. {
  226. double totalPrice = Math.Ceiling(price * 0.20 + price);
  227. Console.WriteLine($"Total price: {totalPrice} lv.");
  228. }
  229. else
  230. {
  231. double totalPrice = Math.Ceiling(price);
  232. Console.WriteLine($"Total price: {totalPrice} lv.");
  233. }
  234. }
  235. else if (nameOfRestorant == "Sushi Bar")
  236. {
  237. double price = numberOfPieces * 4.75;
  238. if (order == "Y")
  239. {
  240. double totalPrice = Math.Ceiling(price * 0.20 + price);
  241. Console.WriteLine($"Total price: {totalPrice} lv.");
  242. }
  243. else
  244. {
  245. double totalPrice = Math.Ceiling(price);
  246. Console.WriteLine($"Total price: {totalPrice} lv.");
  247. }
  248. }
  249. else if (nameOfRestorant == "Asian Pub")
  250. {
  251. double price = numberOfPieces * 5.50;
  252. if (order == "Y")
  253. {
  254. double totalPrice = Math.Ceiling(price * 0.20 + price);
  255. Console.WriteLine($"Total price: {totalPrice} lv.");
  256. }
  257. else
  258. {
  259. double totalPrice = Math.Ceiling(price);
  260. Console.WriteLine($"Total price: {totalPrice} lv.");
  261. }
  262. }
  263.  
  264. break;
  265. default:
  266. Console.WriteLine($"{nameOfRestorant} is invalid restaurant!");
  267. break;
  268. }
  269.  
  270.  
  271. }
  272. }
  273. }
Add Comment
Please, Sign In to add comment