Advertisement
Guest User

Untitled

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