Advertisement
zmuletarova

Untitled

Oct 1st, 2019
115
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_Room
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string month = Console.ReadLine();
  10. int numberOfTheNights = int.Parse(Console.ReadLine());
  11.  
  12. double priceStudio = 0;
  13. double priceApartment = 0;
  14.  
  15. if (month == "May" && month == "Octomber")
  16. {
  17. if (numberOfTheNights <= 7)
  18. {
  19. priceStudio = 50;
  20. priceApartment = 65;
  21. }
  22.  
  23. else if (numberOfTheNights <= 14)
  24. {
  25. priceStudio = 50 * 0.95;
  26. priceApartment = 65;
  27. }
  28.  
  29. else if (numberOfTheNights > 14)
  30. {
  31. priceStudio = 50 * 0.7;
  32. priceApartment = 65 * 0.9;
  33. }
  34.  
  35.  
  36. }
  37.  
  38. else if (month == "June" && month == "September")
  39. {
  40. if (numberOfTheNights <= 14)
  41. {
  42. priceStudio = 75.20;
  43. priceApartment = 68.70;
  44. }
  45.  
  46. else
  47. {
  48. priceStudio = 75.20 * 0.2;
  49. priceApartment = 68.70 * 0.9;
  50. }
  51. }
  52.  
  53. else if (month == "Jule" && month == "August")
  54. {
  55. priceStudio = 76;
  56.  
  57.  
  58. if (numberOfTheNights <= 14)
  59. {
  60. priceApartment = 77;
  61. }
  62.  
  63. else if (numberOfTheNights > 14)
  64. {
  65. priceApartment = 77 * 0.9;
  66. }
  67.  
  68.  
  69. }
  70.  
  71.  
  72. Console.WriteLine($"Apartment: {(numberOfTheNights*priceApartment):f2} lv.");
  73. Console.WriteLine($"Studio: {(numberOfTheNights*priceStudio):f2} lv.");
  74.  
  75. }
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement