Advertisement
Guest User

Vacation

a guest
Jan 20th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Vacation
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int peopleCount = int.Parse(Console.ReadLine());
  10. string typeOfGropu = Console.ReadLine();
  11. string day = Console.ReadLine();
  12. decimal pricePerPerson = 0.0M;
  13. if (typeOfGropu == "Students")
  14. {
  15. if (day == "Friday")
  16. {
  17. pricePerPerson = 8.45M;
  18. }
  19. else if (day == "Saturday")
  20. {
  21. pricePerPerson = 9.80M;
  22. }
  23. else if (day == "Sunday")
  24. {
  25. pricePerPerson = 10.46M;
  26. }
  27. }
  28. else if (typeOfGropu == "Business")
  29. {
  30. if (day == "Fryday")
  31. {
  32. pricePerPerson = 10.90M;
  33. }
  34. else if (day == "Saturday")
  35. {
  36. pricePerPerson = 15.60M;
  37. }
  38. else if (day == "Sunday")
  39. {
  40. pricePerPerson = 16.00M;
  41. }
  42. }
  43. else if (typeOfGropu == "Regular")
  44. {
  45. if (day == "Fryday")
  46. {
  47. pricePerPerson = 15.00M;
  48. }
  49. else if (day == "Saturday")
  50. {
  51. pricePerPerson = 20.00M;
  52. }
  53. else if (day == "Sunday")
  54. {
  55. pricePerPerson = 22.50M;
  56. }
  57. }
  58. decimal totalPrice = pricePerPerson * peopleCount;
  59. if (typeOfGropu == "Students" && peopleCount >= 30)
  60. {
  61. totalPrice *= 0.85M;
  62. }
  63. else if (typeOfGropu == "Business" && peopleCount >= 100)
  64. {
  65. totalPrice -= pricePerPerson * 10;
  66. }
  67. else if (typeOfGropu == "Regular" && peopleCount >= 10 && peopleCount <= 20)
  68. {
  69. totalPrice *= 0.95M;
  70. }
  71. Console.WriteLine($"Total price: {totalPrice:f2}");
  72.  
  73. }
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement