Advertisement
Guest User

Untitled

a guest
Dec 14th, 2019
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.26 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _03._Sushi_Time
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string sushiType = Console.ReadLine();
  10. string restorant = Console.ReadLine();
  11. int portions = int.Parse(Console.ReadLine());
  12. char online = char.Parse(Console.ReadLine());
  13. double total = 0.0;
  14. double price = 0.0;
  15.  
  16. switch (restorant)
  17. {
  18. case "Sushi Zone":
  19. switch (sushiType)
  20. {
  21. case "sashimi":
  22. price = 4.99;
  23. break;
  24. case "maki":
  25. price = 5.29;
  26. break;
  27. case "uramaki":
  28. price = 5.99;
  29. break;
  30. case "temaki":
  31. price = 4.29;
  32. break;
  33. default:
  34. break;
  35. }
  36. break;
  37. case "Sushi Time":
  38. switch (sushiType)
  39. {
  40. case "sashimi":
  41. price = 5.49;
  42. break;
  43. case "maki":
  44. price = 4.69;
  45. break;
  46. case "uramaki":
  47. price = 4.49;
  48. break;
  49. case "temaki":
  50. price = 5.19;
  51. break;
  52. default:
  53. break;
  54. }
  55. break;
  56. case "Sushi Bar":
  57. switch (sushiType)
  58. {
  59. case "sashimi":
  60. price = 5.25;
  61. break;
  62. case "maki":
  63. price = 5.55;
  64. break;
  65. case "uramaki":
  66. price = 6.25;
  67. break;
  68. case "temaki":
  69. price = 4.75;
  70. break;
  71. default:
  72. break;
  73. }
  74. break;
  75. case "Asian Pub":
  76. switch (sushiType)
  77. {
  78. case "sashimi":
  79. price = 4.50;
  80. break;
  81. case "maki":
  82. price = 4.80;
  83. break;
  84. case "uramaki":
  85. price = 5.50;
  86. break;
  87. case "temaki":
  88. price = 5.50;
  89. break;
  90. default:
  91. break;
  92. }
  93. break;
  94. default:
  95. break;
  96. }
  97.  
  98. if (restorant == "Sushi Zone" || restorant == "Sushi Time" || restorant == "Sushi Bar" || restorant == "Asian Pub")
  99. {
  100. if (sushiType == "sashimi")
  101. {
  102. total = portions * price;
  103. }
  104. else if (sushiType == "maki")
  105. {
  106. total = portions * price;
  107. }
  108. else if (sushiType == "uramaki")
  109. {
  110. total = portions * price;
  111. }
  112. else if (sushiType == "temaki")
  113. {
  114. total = portions * price;
  115. }
  116. if (online == 'Y')
  117. {
  118. total = total * 0.20 + total;
  119. }
  120. Console.WriteLine($"Total price: {Math.Ceiling(total)} lv.");
  121. }
  122. else
  123. {
  124. Console.WriteLine($"{restorant} is invalid restaurant!");
  125. }
  126. }
  127. }
  128. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement