Advertisement
BorislavShekerdzhiys

HotelRoom

Nov 19th, 2016
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.34 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace _03.Hotel.Room
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var month = Console.ReadLine().ToLower();
  14. var nightsCount = int.Parse(Console.ReadLine());
  15.  
  16. var studioPrice = 0.0;
  17. var apartmenPrice = 0.0;
  18. var realPriceStudio = 0.0;
  19. var realPriceApart = 0.0;
  20.  
  21. switch (month)
  22. {
  23. case "may":
  24. case "october":
  25. if (nightsCount <= 7)
  26. {
  27. studioPrice = 50.00 * nightsCount;
  28. realPriceStudio = studioPrice;
  29. apartmenPrice = 65.00 * nightsCount;
  30. realPriceApart = apartmenPrice;
  31.  
  32. }
  33. else if (nightsCount > 7 && nightsCount <= 14)
  34. {
  35. studioPrice = 50.00 * nightsCount;
  36. realPriceStudio = studioPrice - (studioPrice * 0.05);
  37. apartmenPrice = 65.00 * nightsCount;
  38. realPriceApart = apartmenPrice;
  39. }
  40. else
  41. {
  42. studioPrice = 50.00 * nightsCount;
  43. realPriceStudio = studioPrice - (studioPrice * 0.30);
  44. apartmenPrice = 65.00 * nightsCount;
  45. realPriceApart = apartmenPrice - (apartmenPrice * 0.10);
  46. }
  47. break;
  48.  
  49. case "june":
  50. case "september":
  51. if (nightsCount > 14 )
  52. {
  53. studioPrice = 75.20 * nightsCount;
  54. realPriceStudio = studioPrice - (studioPrice * 0.20);
  55. apartmenPrice = 68.70 * nightsCount;
  56. realPriceApart = apartmenPrice - (apartmenPrice * 0.10);
  57. }
  58. else
  59. {
  60. studioPrice = 75.20 * nightsCount;
  61. realPriceStudio = studioPrice;
  62. apartmenPrice = 68.70 * nightsCount;
  63. realPriceApart = apartmenPrice;
  64. }
  65. break;
  66. case "july":
  67. case "august":
  68. if (nightsCount > 14)
  69. {
  70. studioPrice = 76.00 * nightsCount;
  71. realPriceStudio = studioPrice;
  72. apartmenPrice = 77.00 * nightsCount;
  73. realPriceApart = apartmenPrice - (apartmenPrice * 0.10);
  74. }
  75. else
  76. {
  77. studioPrice = 76.00 * nightsCount;
  78. realPriceStudio = studioPrice;
  79. apartmenPrice = 77.00 * nightsCount;
  80. realPriceApart = apartmenPrice;
  81. }
  82. break;
  83.  
  84. }
  85.  
  86. Console.WriteLine("Apartment: {0:f2} lv.",realPriceApart);
  87. Console.WriteLine("Studio: {0:f2} lv.",realPriceStudio);
  88.  
  89.  
  90. }
  91. }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement