Guest User

Untitled

a guest
Jan 24th, 2020
184
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.63 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp133
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int people = int.Parse(Console.ReadLine());
  10. string groupType = Console.ReadLine();
  11. string dayOfWeek = Console.ReadLine();
  12.  
  13. double price = 0;
  14. double discount = 0;
  15. double total = 0;
  16.  
  17. //COMMON PRICES
  18. if (dayOfWeek == "Friday")
  19. {
  20. if (groupType == "Students")
  21. {
  22. price = 8.45;
  23. }
  24. else if (groupType == "Business")
  25. {
  26. price = 10.90;
  27. }
  28. else if (groupType == "Regular")
  29. {
  30. price = 15;
  31. }
  32. }
  33. else if (dayOfWeek == "Saturday")
  34. {
  35. if (groupType == "Students")
  36. {
  37. price = 9.8;
  38. }
  39. else if (groupType == "Business")
  40. {
  41. price = 15;
  42. }
  43. else if (groupType == "Regular")
  44. {
  45. price = 20;
  46. }
  47. }
  48. else if (dayOfWeek == "Sunday")
  49. {
  50. if (groupType == "Students")
  51. {
  52. price = 10.46;
  53. }
  54. else if (groupType == "Business")
  55. {
  56. price = 16;
  57. }
  58. else if (groupType == "Regular")
  59. {
  60. price = 22.5;
  61. }
  62. }
  63. //START DISCOUNTS
  64. if (people >= 30 && groupType == "Students")
  65. {
  66. discount = (price * people) * 0.15;
  67. total = (price * people) - discount;
  68. Console.WriteLine($"Total price: {total:f2}");
  69. }
  70. else if (people >= 100 && groupType == "Business")
  71. {
  72. people -= 10;
  73. total = price * people;
  74. Console.WriteLine($"Total price: {total:f2}");
  75. }
  76. else if (people >= 10 && people <= 20 && groupType == "Regular")
  77. {
  78. discount = (price * people) * 0.05;
  79. total = (price * people) - discount;
  80. Console.WriteLine($"Total price: {total:f2}");
  81. }
  82. else
  83. {
  84. total = people * price;
  85. Console.WriteLine($"Total price: {total:f2}");
  86. }
  87. }
  88. }
  89. }
Add Comment
Please, Sign In to add comment