petarkobakov

Hotel room

Jan 31st, 2020
198
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 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 mounth = Console.ReadLine();
  10. int nights = int.Parse(Console.ReadLine());
  11.  
  12.  
  13. double priceSt = 0.0;
  14. double priceAp = 0.0;
  15.  
  16.  
  17. if (mounth == "May" || mounth == "October")
  18. {
  19. priceSt = 50 * nights;
  20. priceAp = 65 * nights;
  21.  
  22. if (nights > 7)
  23. {
  24. priceSt = priceSt - (priceSt * 0.05);
  25. }
  26. else if (nights > 14)
  27. {
  28. priceSt = priceSt - (priceSt * 0.30);
  29. priceAp = priceAp - (priceAp * 0.10);
  30. }
  31. }
  32. else if (mounth == "June" || mounth == "September")
  33. {
  34. priceSt = 75.20 * nights;
  35. priceAp = 68.70 * nights;
  36.  
  37. if (nights > 14)
  38. {
  39. priceSt = priceSt - (priceSt * 0.20);
  40. priceAp = priceAp - (priceAp * 0.10);
  41. }
  42. }
  43. else if (mounth == "July" || mounth == "August")
  44. {
  45. priceSt = 76.00 * nights;
  46. priceAp = 77.00 * nights;
  47.  
  48. if (nights > 14)
  49. {
  50. priceAp = priceAp - (priceAp * 0.10);
  51.  
  52. }
  53. }
  54. Console.WriteLine($"Apartment: {priceAp:f2} lv.");
  55.  
  56. Console.WriteLine($"Studio: {priceSt:f2} lv.");
  57. }
  58. }
  59. }
Advertisement
Add Comment
Please, Sign In to add comment