Advertisement
ahmed_so

Untitled

Feb 27th, 2020
306
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _08._Hotel_Room
  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 priceApartment = 0;
  13. double priceStudio = 0;
  14.  
  15.  
  16.  
  17. switch (month)
  18. {
  19. case "May":
  20. case "October":
  21.  
  22. priceApartment = 65.00;
  23.  
  24. priceStudio = 50.00;
  25.  
  26. if (nights > 7 && nights <= 14)
  27. {
  28.  
  29. priceStudio = priceStudio - priceStudio * 0.05;
  30. }
  31. if (nights > 14)
  32. {
  33. priceStudio = priceStudio - priceStudio * 0.30;
  34. priceApartment = priceApartment - priceApartment * 0.1;
  35. }
  36. break;
  37.  
  38. case "June":
  39. case "September":
  40.  
  41. priceApartment = 68.70;
  42.  
  43. priceStudio = 75.20;
  44.  
  45. if (nights > 14)
  46. {
  47. priceStudio = priceStudio - priceStudio * 0.20;
  48. priceApartment = priceApartment - priceApartment * 0.1;
  49. }
  50. break;
  51.  
  52.  
  53. case "July":
  54. case "August":
  55.  
  56. priceApartment = 77.00;
  57.  
  58. priceStudio = 76.00;
  59.  
  60. if (nights > 14)
  61. {
  62. priceApartment = priceApartment - priceApartment * 0.1;
  63. }
  64. break;
  65. }
  66. Console.WriteLine($"Apartment: {priceApartment * nights:f2} lv.");
  67. Console.WriteLine($"Studio: {priceStudio * nights:f2} lv.");
  68.  
  69. }
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement