Advertisement
Guest User

Untitled

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