spasnikolov131

Untitled

May 4th, 2023
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.83 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Hotel_Room
  4. {
  5. internal class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string month = Console.ReadLine();
  10. int accomodation = int.Parse(Console.ReadLine());
  11. decimal totalStudio = 0;
  12. decimal totalApartment = 0;
  13. decimal discountStudio = 0;
  14. decimal discountApartment = 0.10m;
  15.  
  16.  
  17. if (month == "May" || month == "October")
  18. {
  19. decimal studio = 50;
  20. decimal apartment = 65;
  21.  
  22. if (accomodation >= 7 && accomodation <= 14)
  23. {
  24. discountStudio = 0.05m;
  25. discountStudio = studio * discountStudio;
  26. totalStudio = (studio - discountStudio) * accomodation;
  27. totalApartment = apartment * accomodation;
  28. }
  29. if (accomodation > 14)
  30. {
  31. discountStudio = 0.30m;
  32. discountStudio = studio * discountStudio;
  33. totalStudio = (studio - discountStudio) * accomodation;
  34. discountApartment = apartment * discountApartment;
  35. totalApartment = (apartment - discountApartment) * accomodation;
  36. }
  37. }
  38. if (month == "June" || month == "September")
  39. {
  40. decimal studio = 75.20m;
  41. decimal apartment = 68.70m;
  42. totalStudio = studio * accomodation;
  43. totalApartment = apartment * accomodation;
  44.  
  45. if (accomodation > 14)
  46. {
  47. discountStudio = 0.20m;
  48. discountStudio = studio * discountStudio;
  49. totalStudio = (studio - discountStudio) * accomodation;
  50. discountApartment = apartment * discountApartment;
  51. totalApartment = (apartment - discountApartment) * accomodation;
  52. }
  53. }
  54. if (month == "July" || month == "August")
  55. {
  56. decimal studio = 76;
  57. decimal apartment = 77;
  58. if (accomodation > 7)
  59. {
  60. totalApartment = apartment * accomodation;
  61. totalStudio = studio * accomodation;
  62. }
  63. if (accomodation > 14)
  64. {
  65. totalStudio = studio * accomodation;
  66.  
  67. discountApartment = apartment * discountApartment;
  68. totalApartment = (apartment - discountApartment) * accomodation;
  69. }
  70. }
  71.  
  72.  
  73. Console.WriteLine($"Apartment: {totalApartment:f2} lv.");
  74. Console.WriteLine($"Studio: {totalStudio:f2} lv.");
  75.  
  76.  
  77.  
  78.  
  79.  
  80.  
  81.  
  82.  
  83.  
  84. }
  85. }
  86. }
  87.  
Advertisement
Add Comment
Please, Sign In to add comment