Advertisement
Guest User

Untitled

a guest
Apr 11th, 2019
599
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _08.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 priceApartment = 0.0;
  13. double priceStudio = 0.0;
  14.  
  15. if (month == "May" || month == "October")
  16. {
  17. priceApartment = 65.0;
  18. priceStudio = 50.0;
  19. if (nights>7&& nights<=14)
  20. {
  21. priceStudio *= 0.95;
  22. }
  23. else if (nights > 14 )
  24. {
  25. priceStudio *= 0.7;
  26. }
  27. }
  28. else if (month == "June" || month == "September")
  29. {
  30. priceApartment = 68.70;
  31. priceStudio = 75.20;
  32. if (nights>14)
  33. {
  34. priceStudio = 0.8;
  35. }
  36. }
  37. else if (month == "July" || month == "August")
  38. {
  39. priceApartment = 77.0;
  40. priceStudio = 76.0;
  41. }
  42.  
  43. if (nights>14)
  44. {
  45. priceApartment *= 0.90;
  46. }
  47. Console.WriteLine($"Apartment: {(priceApartment * nights):f2} lv.");
  48. Console.WriteLine($"Studio: {(priceStudio * nights):f2} lv.");
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement