Advertisement
OOrlin

Hotel Room

Oct 27th, 2019
1,120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.28 KB | None | 0 0
  1. using System;
  2.  
  3. namespace HotelRoom
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string month = Console.ReadLine();
  10. double nights = double.Parse(Console.ReadLine());
  11.  
  12. double studioMO = 50;
  13. double ApartmentMO = 65;
  14. double studioJniS = 75.20;
  15. double ApartmentJniS = 68.70;
  16. double studioJA = 76;
  17. double ApartmentJa = 77;
  18. double priceStudio = 0;
  19. double priceApartment = 0;
  20.  
  21. if (month == "May" || month == "October")
  22. {
  23. if (nights <= 7)
  24. {
  25. priceStudio = studioMO;
  26. priceApartment = ApartmentMO;
  27.  
  28. }
  29. else if (nights > 7 && nights <= 14)
  30. {
  31. priceStudio = studioMO * 0.95;
  32. priceApartment = ApartmentMO;
  33.  
  34. }
  35. else if (nights > 14)
  36. {
  37. priceStudio = studioMO * 0.70;
  38. priceApartment = ApartmentMO * 0.9;
  39. }
  40. }
  41. else if (month == "June" || month == "September")
  42. {
  43. if (nights >= 15)
  44. {
  45. priceStudio = studioJniS * 0.80;
  46. priceApartment = ApartmentJniS * 0.9;
  47. }
  48. else if (nights <15)
  49. {
  50. priceStudio = studioJniS;
  51. priceApartment = ApartmentJniS;
  52.  
  53. }
  54. }
  55. else if (month == "July" || month== "August")
  56. {
  57. if (nights >= 15)
  58. {
  59. priceStudio = studioJA;
  60. priceApartment = ApartmentJa * 0.90;
  61. }
  62. else if (nights <15)
  63. {
  64.  
  65. priceStudio = studioJA;
  66. priceApartment = ApartmentJa;
  67. }
  68. }
  69.  
  70.  
  71. Console.WriteLine($"Apartment: {(priceApartment*nights):f2} lv.");
  72. Console.WriteLine($"Studio: {(priceStudio*nights):f2} lv.");
  73.  
  74.  
  75. }
  76.  
  77.  
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement