Advertisement
Guest User

Untitled

a guest
Jan 18th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 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 count = int.Parse(Console.ReadLine());
  10. string type = Console.ReadLine();
  11. string day = Console.ReadLine();
  12. decimal price = 0;
  13.  
  14. if (day == "Friday")
  15. {
  16. switch (type)
  17. {
  18. case "Students": price = count * 8.45M; break;
  19. case "Business": price = count * 10.90M; break;
  20. case "Regular" : price = count * 15.00M; break;
  21. }
  22.  
  23.  
  24. }
  25.  
  26. else if (day == "Saturday")
  27. {
  28. switch (type)
  29. {
  30. case "Students": price = count * 9.80M; break;
  31. case "Business": price = count * 15.60M; break;
  32. case "Regular" : price = count * 20.00M; break;
  33. }
  34. }
  35.  
  36. else if (day == "Sunday")
  37. {
  38. switch (type)
  39. {
  40. case "Students": price = count * 10.46M; break;
  41. case "Business": price = count * 16.00M; break;
  42. case "Regular" : price = count * 22.50M; break;
  43. }
  44. }
  45.  
  46.  
  47. if (type == "Students")
  48. {
  49.  
  50.  
  51. if (count >= 30 && type == "Students")
  52. {
  53. price *= 0.85M;
  54. Console.WriteLine($"Total price: {price:f2}");
  55. }
  56.  
  57. else
  58. {
  59. Console.WriteLine($"Total price: {price:f2}");
  60. }
  61. }
  62.  
  63. if (type == "Business")
  64. {
  65.  
  66.  
  67. if (count >= 100 && type == "Business")
  68. {
  69. price = price * (count - 10);
  70. Console.WriteLine($"Total price: {price:f2}");
  71. }
  72.  
  73. else
  74. {
  75. Console.WriteLine($"Total price: {price:f2}");
  76. }
  77. }
  78.  
  79.  
  80. if (type == "Regular")
  81. {
  82.  
  83.  
  84. if (count >= 10 && count <= 20 && type == "Regular")
  85. {
  86. price *= 0.95M;
  87. Console.WriteLine($"Total price: {price:f2}");
  88.  
  89. }
  90.  
  91. else
  92. {
  93. Console.WriteLine($"Total price: {price:f2}");
  94. }
  95. }
  96.  
  97.  
  98.  
  99.  
  100. }
  101. }
  102. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement