Advertisement
Guest User

04. Hotel

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