Advertisement
Guest User

Pr03_Restaurant Discount

a guest
May 31st, 2017
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 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 ConsoleApplication1.Conditional_Statements_and_Loops
  8. {
  9. class Pr03_Restaurant_Discount
  10. {
  11. public static void Main(string[] args)
  12. {
  13. int groupSize = int.Parse(Console.ReadLine());
  14. string type = Console.ReadLine();
  15. double price = 0;
  16. string hallName = "";
  17. bool ofLimit = false;
  18.  
  19.  
  20.  
  21. if (groupSize <= 50)
  22. {
  23. price = 2500;
  24. hallName = "Small Hall";
  25.  
  26. }
  27. else if (groupSize > 50 && groupSize <= 100)
  28. {
  29. price = 5000;
  30. hallName = "Terrace";
  31. }
  32. else if (groupSize > 100 && groupSize <= 120)
  33. {
  34. price = 7500;
  35. hallName = "Great Hall";
  36. }
  37.  
  38.  
  39. else
  40. {
  41. Console.WriteLine("We do not have an appropriate hall.");
  42. ofLimit = true;
  43.  
  44. }
  45.  
  46.  
  47.  
  48. switch (type)
  49. {
  50. case "Normal":
  51. price += 500;
  52. price = (price - (price * 0.05)) / groupSize;
  53. break;
  54. case "Gold":
  55. price += 750;
  56. price = (price - (price * 0.10)) / groupSize;
  57. break;
  58. case "Platinum":
  59. price += 1000;
  60. price = (price - (price * 0.15)) / groupSize;
  61. break;
  62. }
  63.  
  64.  
  65. if (!ofLimit)
  66. {
  67. Console.WriteLine($"We can offer you the {hallName}\nThe price per person is {price:f2}$");
  68. }
  69.  
  70. }
  71. }
  72. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement