Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.86 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.  
  10. string month = Console.ReadLine();
  11. double nights = double.Parse(Console.ReadLine());
  12. double priceStudio = 0;
  13. double priceApartment = 0;
  14.  
  15. switch (month)
  16. {
  17. case "May":
  18. case "October":
  19. priceStudio = 50;
  20. priceApartment = 65;
  21. if (nights > 14)
  22. {
  23. priceStudio *= 0.70;
  24. priceApartment *= 0.90;
  25. }
  26. else if (nights>7)
  27. {
  28. priceStudio *= 0.95;
  29. }
  30.  
  31. break;
  32. case "June":
  33. case "September":
  34. priceStudio = 75.20;
  35. priceApartment = 68.70;
  36. if (nights > 14)
  37. {
  38. priceStudio *= 0.80;
  39. priceApartment *= 0.90;
  40. }
  41. break;
  42. case "July":
  43. case "August":
  44. priceStudio = 76;
  45. priceApartment = 77;
  46. if (nights > 14)
  47. {
  48. priceApartment *= 0.90;
  49. }
  50. break;
  51. default:
  52. break;
  53. }
  54.  
  55. double totalApartment = nights * priceApartment;
  56. double totalStudio = nights * priceStudio;
  57.  
  58. Console.WriteLine($"Apartment: {totalApartment:f2} lv.");
  59. Console.WriteLine($"Studio: {totalStudio:f2} lv.");
  60.  
  61.  
  62.  
  63.  
  64.  
  65.  
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement