Advertisement
Guest User

Untitled

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