Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2018
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.71 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 = string.Empty;
  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. }
  37. }
  38. else if (typeOfSushi == "maki")
  39. {
  40. switch (restrestaurantName)
  41. {
  42. case "Sushi Zone":
  43. priceforOnePortion = 5.29;
  44. break;
  45. case "Sushi Time":
  46. priceforOnePortion = 4.69;
  47. break;
  48. case "Sushi Bar":
  49. priceforOnePortion = 5.55;
  50. break;
  51. case "Asian Pub":
  52. priceforOnePortion = 4.80;
  53. break;
  54. }
  55. }
  56. else if (typeOfSushi == "uramaki")
  57. {
  58. switch (restrestaurantName)
  59. {
  60. case "Sushi Zone":
  61. priceforOnePortion = 5.99;
  62. break;
  63. case "Sushi Time":
  64. priceforOnePortion = 4.49;
  65. break;
  66. case "Sushi Bar":
  67. priceforOnePortion = 6.25;
  68. break;
  69. case "Asian Pub":
  70. priceforOnePortion = 5.50;
  71. break;
  72. }
  73. }
  74. else if (typeOfSushi == "temaki")
  75. {
  76. switch (restrestaurantName)
  77. {
  78. case "Sushi Zone":
  79. priceforOnePortion = 4.29;
  80. break;
  81. case "Sushi Time":
  82. priceforOnePortion = 5.19;
  83. break;
  84. case "Sushi Bar":
  85. priceforOnePortion = 4.75;
  86. break;
  87. case "Asian Pub":
  88. priceforOnePortion = 5.50;
  89. break;
  90. }
  91. }
  92. if (order == "Y")
  93. {
  94. totalPrice = Math.Ceiling(numberOfPortions * priceforOnePortion) * 1.2;
  95. }
  96. else
  97. {
  98. totalPrice = Math.Ceiling(numberOfPortions * priceforOnePortion);
  99. }
  100. Console.WriteLine($"Total price: {totalPrice}");
  101. if (restrestaurantName != "Sushi Zone" && restrestaurantName != "Sushi Time" && restrestaurantName != "Sushi Bar" && restrestaurantName != "Asian Pub")
  102. {
  103. Console.WriteLine($"{restrestaurantName} is invalid restaurant!");
  104. }
  105. }
  106. }
  107. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement