Guest User

Untitled

a guest
Jan 31st, 2020
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.34 KB | None | 0 0
  1. using System;
  2.  
  3. namespace IzpitnaZadacha8
  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 priceStudio = 0;
  13. double priceApartment = 0;
  14.  
  15.  
  16. if (month == "May" || month == "October")
  17. {
  18. if (nights < 7)
  19. {
  20. priceStudio = (nights * 50);
  21. priceApartment = (nights * 65);
  22. }
  23. else if (7 <= nights && nights <= 14)
  24. {
  25. priceStudio = (nights * 50) * 0.95;
  26. priceApartment = (nights * 65);
  27. }
  28. else
  29. {
  30. priceStudio = (nights * 50) * 0.7;
  31. priceApartment = (nights * 65) * 0.9;
  32. }
  33. }
  34. else if (month == "June" || month == "September")
  35. {
  36. if (nights < 7)
  37. {
  38. priceStudio = (nights * 75.2);
  39. priceApartment = (nights * 68.7);
  40. }
  41. else if (7 <= nights && nights <= 14)
  42. {
  43. priceStudio = (nights * 75.2);
  44. priceApartment = (nights * 68.7);
  45. }
  46. else
  47. {
  48. priceStudio = (nights * 75.2) * 0.8;
  49. priceApartment = (nights * 68.7) * 0.9;
  50. }
  51. }
  52.  
  53. else if (month == "July" || month == "August")
  54. {
  55. if (nights < 7)
  56. {
  57. priceStudio = (nights * 76);
  58. priceApartment = (nights * 77);
  59. }
  60. else if (7 <= nights && nights <= 14)
  61. {
  62. priceStudio = (nights * 76);
  63. priceApartment = (nights * 77);
  64. }
  65. else
  66. {
  67. priceStudio = (nights * 76);
  68. priceApartment = (nights * 77) * 0.9;
  69. }
  70. }
  71.  
  72. Console.WriteLine($"Apartment: {priceApartment:F2} lv.");
  73. Console.WriteLine($"Studio: {priceStudio:F2} lv.");
  74. }
  75.  
  76. }
  77. }
Add Comment
Please, Sign In to add comment