Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.74 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 _3_Vacation_2._0
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int groupCount = int.Parse(Console.ReadLine());
  14. string groupType = Console.ReadLine();
  15. string dayOfWeek = Console.ReadLine();
  16. decimal singularPrice = 0;
  17. decimal totalPrice = 0;
  18.  
  19. if (groupType == "Students")
  20. {
  21. if (dayOfWeek == "Friday")
  22. {
  23. singularPrice = 8.45m;
  24. }
  25. else if (dayOfWeek == "Saturday")
  26. {
  27. singularPrice = 9.80m;
  28. }
  29. else if (dayOfWeek == "Sunday")
  30. {
  31. singularPrice = 10.46m;
  32. }
  33.  
  34. if (groupCount >= 30)
  35. {
  36. totalPrice = (singularPrice * groupCount) * 85 / 100;
  37. }
  38. else
  39. {
  40. totalPrice = singularPrice * groupCount;
  41. }
  42. }
  43.  
  44. else if (groupType == "Business")
  45. {
  46. if (dayOfWeek == "Friday")
  47. {
  48. singularPrice = 10.90m;
  49. }
  50. else if (dayOfWeek == "Saturday")
  51. {
  52. singularPrice = 15.60m;
  53. }
  54. else if (dayOfWeek == "Sunday")
  55. {
  56. singularPrice = 16;
  57. }
  58.  
  59. if (groupCount >= 100)
  60. {
  61. totalPrice = singularPrice * (groupCount - 10);
  62. }
  63. else
  64. {
  65. totalPrice = singularPrice * groupCount;
  66. }
  67. }
  68.  
  69. else if (groupType == "Regular")
  70. {
  71. if (dayOfWeek == "Friday")
  72. {
  73. singularPrice = 15m;
  74. }
  75. else if (dayOfWeek == "Saturday")
  76. {
  77. singularPrice = 20m;
  78. }
  79. else if (dayOfWeek == "Sunday")
  80. {
  81. singularPrice = 22.5m;
  82. }
  83.  
  84. if (groupCount >= 10 && groupCount <= 20)
  85. {
  86. totalPrice = (singularPrice * groupCount) * 95 / 100;
  87. }
  88. else
  89. {
  90. totalPrice = singularPrice * groupCount;
  91. }
  92. }
  93.  
  94.  
  95. Console.WriteLine($"Total price: {totalPrice:f2}");
  96. }
  97. }
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement