Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.17 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 _03_Sushi_Time
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string typeOfSushi = Console.ReadLine();
  14. string restrestaurantName = Console.ReadLine();
  15. int numberOfPortions = int.Parse(Console.ReadLine());
  16. string order = Console.ReadLine();
  17. double priceforOnePortion = 0;
  18. double totalPrice = 0;
  19.  
  20. if (typeOfSushi == "sashimi")
  21. {
  22. switch (restrestaurantName)
  23. {
  24. case "Sushi Zone":
  25. priceforOnePortion = 4.99;
  26. break;
  27. case "Sushi Time":
  28. priceforOnePortion = 5.49;
  29. break;
  30. case "Sushi Bar":
  31. priceforOnePortion = 5.25;
  32. break;
  33. case "Asian Pub":
  34. priceforOnePortion = 5.25;
  35. break;
  36. default:
  37. Console.WriteLine($"{restrestaurantName} is invalid restaurant!");
  38. break;
  39. }
  40. }
  41. else if (typeOfSushi == "maki")
  42. {
  43. switch (restrestaurantName)
  44. {
  45. case "Sushi Zone":
  46. priceforOnePortion = 5.29;
  47. break;
  48. case "Sushi Time":
  49. priceforOnePortion = 4.69;
  50. break;
  51. case "Sushi Bar":
  52. priceforOnePortion = 5.55;
  53. break;
  54. case "Asian Pub":
  55. priceforOnePortion = 4.80;
  56. break;
  57. default:
  58. Console.WriteLine($"{restrestaurantName} is invalid restaurant!");
  59. break;
  60. }
  61. }
  62. else if (typeOfSushi == "uramaki")
  63. {
  64. switch (restrestaurantName)
  65. {
  66. case "Sushi Zone":
  67. priceforOnePortion = 5.99;
  68. break;
  69. case "Sushi Time":
  70. priceforOnePortion = 4.49;
  71. break;
  72. case "Sushi Bar":
  73. priceforOnePortion = 6.25;
  74. break;
  75. case "Asian Pub":
  76. priceforOnePortion = 5.50;
  77. break;
  78. default:
  79. Console.WriteLine($"{restrestaurantName} is invalid restaurant!");
  80. break;
  81. }
  82. }
  83. else if (typeOfSushi == "temaki")
  84. {
  85. switch (restrestaurantName)
  86. {
  87. case "Sushi Zone":
  88. priceforOnePortion = 4.29;
  89. break;
  90. case "Sushi Time":
  91. priceforOnePortion = 5.19;
  92. break;
  93. case "Sushi Bar":
  94. priceforOnePortion = 4.75;
  95. break;
  96. case "Asian Pub":
  97. priceforOnePortion = 5.50;
  98. break;
  99. default:
  100. Console.WriteLine($"{restrestaurantName} is invalid restaurant!");
  101. break;
  102. }
  103. }
  104. double cost = numberOfPortions * priceforOnePortion;
  105. if (cost != 0)
  106. {
  107. if (order == "Y")
  108. {
  109. totalPrice = (cost * 1.2);
  110. Console.WriteLine($"Total price: {Math.Ceiling(totalPrice)} lv.");
  111. }
  112. else
  113. {
  114. Console.WriteLine($"Total price: {Math.Ceiling(cost)} lv.");
  115.  
  116. }
  117. }
  118.  
  119. }
  120. }
  121. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement