Advertisement
zmuletarova

Untitled

Oct 3rd, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.85 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. priceApartment = 65;
  18.  
  19.  
  20. if (numberOfTheNights <= 7)
  21. {
  22. priceStudio = 50;
  23.  
  24. }
  25.  
  26. else if (numberOfTheNights > 7 && numberOfTheNights <= 14)
  27. {
  28. priceStudio = 50 * 0.95;
  29.  
  30. }
  31.  
  32. else
  33. {
  34. priceStudio = 50 * 0.7;
  35. priceApartment = 65 * 0.9;
  36. }
  37.  
  38.  
  39. }
  40.  
  41. else if (month == "June" || month == "September")
  42. {
  43. priceApartment = 68.70;
  44. priceStudio = 75.20;
  45.  
  46. if (numberOfTheNights > 14)
  47. {
  48.  
  49. priceStudio = 75.20 * 0.8;
  50. priceApartment = 68.70 * 0.9;
  51. }
  52. }
  53.  
  54. else if (month == "Jule" || month == "August")
  55. {
  56.  
  57. priceStudio = 76;
  58. priceApartment = 77;
  59.  
  60.  
  61. if (numberOfTheNights > 14)
  62. {
  63. priceApartment = 77 * 0.90;
  64. }
  65.  
  66. }
  67.  
  68. Console.WriteLine($"Apartment: {(numberOfTheNights*priceApartment):f2} lv.");
  69. Console.WriteLine($"Studio: {(numberOfTheNights*priceStudio):f2} lv.");
  70.  
  71. }
  72. }
  73. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement