Advertisement
viraco4a

fixed

May 16th, 2018
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.96 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.  
  12.  
  13.  
  14. double studioPrice = 0;
  15. double doublePrice = 0;
  16. double suitePrice = 0;
  17.  
  18. if (month == "May" || month == "October")
  19. {
  20. if (month == "October" && nights > 7)
  21. {
  22. studioPrice = 50 * --nights;
  23. nights++;
  24. }
  25. else
  26. {
  27. studioPrice = 50 * nights;
  28. }
  29. doublePrice = 65 * nights;
  30. suitePrice = 75 * nights;
  31. if (nights > 7)
  32. {
  33. studioPrice = studioPrice * 0.95;
  34. }
  35. }
  36.  
  37. if (month == "June" || month == "September")
  38. {
  39. studioPrice = 60 * nights;
  40. doublePrice = 72 * nights;
  41. suitePrice = 82 * nights;
  42. if (nights > 14)
  43. {
  44. doublePrice = doublePrice * 0.90;
  45. }
  46. if (nights > 7 || month == "September")
  47. {
  48. studioPrice = studioPrice - 60;
  49. }
  50. }
  51.  
  52. if (month == "July" || month == "August" || month == "December")
  53. {
  54. studioPrice = 68 * nights;
  55. doublePrice = 77 * nights;
  56. suitePrice = 89 * nights;
  57. if (nights > 14)
  58. {
  59. suitePrice = suitePrice * 0.85;
  60. }
  61. }
  62.  
  63.  
  64. Console.WriteLine("Studio: {0:f2} lv.", studioPrice);
  65. Console.WriteLine("Double: {0:f2} lv.", doublePrice);
  66. Console.WriteLine("Suite: {0:f2} lv.", suitePrice);
  67.  
  68. }
  69. }
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement