Advertisement
Guest User

Restaurant Discount

a guest
May 20th, 2018
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.96 KB | None | 0 0
  1. using System;
  2.  
  3. namespace RestaurantDiscount
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int groupsize = int.Parse(Console.ReadLine());
  10. string package = Console.ReadLine();
  11. double price = 0;
  12. string typehall = "";
  13. double discount = 0;
  14. double pricePerson = 0;
  15.  
  16.  
  17. if (groupsize <= 50)
  18. {
  19. switch (package) {
  20. case "Gold":
  21.  
  22. typehall = "Small Hall";
  23. price = 2500 + 750;
  24. discount = (price - (price * 10) / 100);
  25. pricePerson = discount / groupsize;
  26. Console.WriteLine($"We can offer you the {typehall}");
  27. Console.WriteLine($"The price per person is {pricePerson:f2}$");
  28. break;
  29. case "Normal":
  30.  
  31. typehall = "Small Hall";
  32. price = 2500 + 500;
  33. discount = (price - (price * 5) / 100);
  34. pricePerson = discount / groupsize;
  35. Console.WriteLine($"We can offer you the {typehall}");
  36. Console.WriteLine($"The price per person is {pricePerson:f2}$");
  37. break;
  38. case "Platinum":
  39.  
  40. typehall = "Small Hall";
  41. price = 2500 + 1000;
  42. discount = (price - (price * 15) / 100);
  43. pricePerson = discount / groupsize;
  44. Console.WriteLine($"We can offer you the {typehall}");
  45. Console.WriteLine($"The price per person is {pricePerson:f2}$");
  46. break;
  47.  
  48. }
  49. }
  50. else if (groupsize <= 100)
  51. {
  52. switch (package)
  53. {
  54. case "Gold":
  55.  
  56. typehall = "Terrace";
  57. price = 5000 + 750;
  58. discount = (price - (price * 10) / 100);
  59. pricePerson = discount / groupsize;
  60. Console.WriteLine($"We can offer you the {typehall}");
  61. Console.WriteLine($"The price per person is {pricePerson:f2}$");
  62. break;
  63. case "Normal":
  64.  
  65. typehall = "Terrace";
  66. price = 5000 + 500;
  67. discount = (price - (price * 5) / 100);
  68. pricePerson = discount / groupsize;
  69. Console.WriteLine($"We can offer you the {typehall}");
  70. Console.WriteLine($"The price per person is {pricePerson:f2}$");
  71. break;
  72. case "Platinum":
  73.  
  74. typehall = "Terrace";
  75. price = 5000 + 1000;
  76. discount = (price - (price * 15) / 100);
  77. pricePerson = discount / groupsize;
  78. Console.WriteLine($"We can offer you the {typehall}");
  79. Console.WriteLine($"The price per person is {pricePerson:f2}$");
  80. break;
  81.  
  82. }
  83. } else if (groupsize<= 120)
  84. {
  85. switch (package)
  86. {
  87. case "Gold":
  88.  
  89. typehall = "Great Hall";
  90. price = 7000 + 750;
  91. discount = (price - (price * 10) / 100);
  92. pricePerson = discount / groupsize;
  93. Console.WriteLine($"We can offer you the {typehall}");
  94. Console.WriteLine($"The price per person is {pricePerson:f2}$");
  95. break;
  96. case "Normal":
  97.  
  98. typehall = "Great Hall";
  99. price = 7000 + 500;
  100. discount = (price - (price * 5) / 100);
  101. pricePerson = discount / groupsize;
  102. Console.WriteLine($"We can offer you the {typehall}");
  103. Console.WriteLine($"The price per person is {pricePerson:f2}$");
  104. break;
  105. case "Platinum":
  106.  
  107. typehall = "Great Hall";
  108. price = 7000 + 1000;
  109. discount = (price - (price * 15) / 100);
  110. pricePerson = discount / groupsize;
  111. Console.WriteLine($"We can offer you the {typehall}");
  112. Console.WriteLine($"The price per person is {pricePerson:f2}$");
  113. break;
  114.  
  115. }
  116. }
  117. else
  118. {
  119. Console.WriteLine("We do not have an appropriate hall.");
  120. return;
  121. }
  122. }
  123. }
  124. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement