Guest User

Untitled

a guest
Sep 23rd, 2017
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.21 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 Problem_4.Hotel
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var month = Console.ReadLine();
  14. var nights = int.Parse(Console.ReadLine());
  15.  
  16. decimal discount = 1;
  17.  
  18. if (month == "May")
  19. {
  20. if (nights > 7)
  21. {
  22. discount = 0.95m;
  23. Console.WriteLine("Studio: {0:f2} lv.", nights * 50 * discount);
  24. }
  25. else
  26. {
  27. Console.WriteLine("Studio: {0:f2} lv.", nights * 50);
  28. }
  29. Console.WriteLine("Double: {0:f2} lv.", nights * 65);
  30. Console.WriteLine("Suite: {0:f2} lv.", nights * 75);
  31. }
  32. else if (month == "October")
  33. {
  34. if (nights > 7)
  35. {
  36. discount = 0.95m;
  37. Console.WriteLine("Studio: {0:f2} lv.", (nights - 1) * 50 * discount);
  38. }
  39. else
  40. {
  41. Console.WriteLine("Studio: {0:f2} lv.", nights * 50);
  42. }
  43. Console.WriteLine("Double: {0:f2} lv.", nights * 65);
  44. Console.WriteLine("Suite: {0:f2} lv.", nights * 75);
  45. }
  46. else if (month == "June")
  47. {
  48.  
  49. if (nights > 14)
  50. {
  51. discount = 0.90m;
  52. Console.WriteLine("Studio: {0:f2} lv.", nights * 60);
  53. Console.WriteLine("Double: {0:f2} lv.", nights * discount * 72);
  54. Console.WriteLine("Suite: {0:f2} lv.", nights * 82);
  55.  
  56. }
  57. else
  58. {
  59. Console.WriteLine("Studio: {0:f2} lv.", nights * 60);
  60. Console.WriteLine("Double: {0:f2} lv.", nights * 72);
  61. Console.WriteLine("Suite: {0:f2} lv.", nights * 82);
  62. }
  63. }
  64. else if (month == "September")
  65. {
  66. if (nights > 14)
  67. {
  68. Console.WriteLine("Studio: {0:f2} lv.", (nights - 1) * 60);
  69. discount = 0.90m;
  70. }
  71. else if (nights > 7 && nights <= 14)
  72. {
  73. Console.WriteLine("Studio: {0:f2} lv.", (nights - 1) * 60);
  74. }
  75. else
  76. {
  77. Console.WriteLine("Studio: {0:f2} lv.", nights * 60);
  78. }
  79. Console.WriteLine("Double: {0:f2} lv.", nights * discount * 72);
  80. Console.WriteLine("Suite: {0:f2} lv.", nights * 82);
  81. }
  82. else
  83. {
  84. Console.WriteLine("Studio: {0:f2} lv.", nights * 68);
  85. Console.WriteLine("Double: {0:f2} lv.", nights * 77);
  86.  
  87. if (nights > 14)
  88. {
  89. discount = 0.85m;
  90. }
  91. Console.WriteLine("Suite: {0:f2} lv.", nights * discount * 89);
  92. }
  93. }
  94. }
  95. }
Add Comment
Please, Sign In to add comment