Advertisement
semelyna

Untitled

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