Advertisement
social1986

Hotel.2

Sep 26th, 2017
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.32 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace Problem_4.Hotel
  5. {
  6. public class Program
  7. {
  8. public static void Main()
  9. {
  10. var month = Console.ReadLine();
  11. var nights = int.Parse(Console.ReadLine());
  12. var studioPrice = 0.0;
  13. var doublePrice = 0.0;
  14. var suitePrice = 0.0;
  15.  
  16. switch (month)
  17. {
  18.  
  19. case "May":
  20.  
  21. if (nights > 7)
  22. {
  23. studioPrice = nights * 50.00 * 0.95;
  24. doublePrice = nights * 65;
  25. suitePrice = nights * 75;
  26. }
  27. else
  28. {
  29. studioPrice = nights * 50.00;
  30. doublePrice = nights * 65;
  31. suitePrice = nights * 75;
  32. }
  33. break;
  34.  
  35. case "October":
  36.  
  37. if (nights > 7)
  38. {
  39. studioPrice = ((nights - 1) * 50.00) * 0.95;
  40. doublePrice = nights * 65;
  41. suitePrice = nights * 75;
  42. }
  43. else
  44. {
  45. studioPrice = nights * 50;
  46. doublePrice = nights * 65;
  47. suitePrice = nights * 75;
  48. }
  49. break;
  50.  
  51. case "June":
  52.  
  53. if (nights > 14)
  54. {
  55. studioPrice = nights * 60;
  56. doublePrice = nights * 72 * 0.90;
  57. suitePrice = nights * 82;
  58. }
  59. else
  60. {
  61. studioPrice = nights * 60;
  62. doublePrice = nights * 72;
  63. suitePrice = nights * 82;
  64. }
  65. break;
  66.  
  67. case "July":
  68. case "August":
  69. case "December":
  70.  
  71. if (nights > 14)
  72. {
  73. studioPrice = nights * 68;
  74. doublePrice = nights * 77;
  75. suitePrice = nights * 89 * 0.85;
  76. }
  77. else
  78. {
  79. studioPrice = nights * 68;
  80. doublePrice = nights * 77;
  81. suitePrice = nights * 89;
  82. }
  83. break;
  84.  
  85. case "September":
  86.  
  87. if (nights > 14)
  88. {
  89. studioPrice = (nights - 1) * 60;
  90. doublePrice = nights * 72 * 0.90;
  91. suitePrice = nights * 82;
  92. }
  93. else if (nights > 7)
  94. {
  95. studioPrice = (nights - 1) * 60;
  96. doublePrice = nights * 72;
  97. suitePrice = nights * 82;
  98. }
  99. break;
  100. }
  101. Console.WriteLine($"Studio: {studioPrice:f2} lv.");
  102. Console.WriteLine($"Double: {doublePrice:f2} lv.");
  103. Console.WriteLine($"Suite: {suitePrice:f2} lv.");
  104. }
  105. }
  106. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement