Advertisement
Guest User

Untitled

a guest
Jun 4th, 2018
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.71 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 ExamHotelRoom
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string month = Console.ReadLine();
  14. int stay = int.Parse(Console.ReadLine());
  15. double fullStayApartment = 0.0;
  16. double fullStayStudio = 0.0;
  17. double apartmentPrice = 0.0;
  18. double studioPrice = 0.0;
  19.  
  20. if (month=="May" || month=="October")
  21. {
  22. studioPrice = 50;
  23. apartmentPrice = 65;
  24. if (stay>7&&stay<14)
  25. {
  26. studioPrice -= 0.05 * studioPrice;
  27. fullStayApartment = stay * apartmentPrice;
  28. fullStayStudio = stay * studioPrice;
  29. Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
  30. Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
  31. }
  32. else if (stay>14)
  33. {
  34. studioPrice -= 0.30 * studioPrice;
  35. apartmentPrice -= 0.10 * apartmentPrice;
  36. fullStayApartment = stay * apartmentPrice;
  37. fullStayStudio = stay * studioPrice;
  38. Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
  39. Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
  40. }
  41. else
  42. {
  43. fullStayApartment = stay * apartmentPrice;
  44. fullStayStudio = stay * studioPrice;
  45. Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
  46. Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
  47. }
  48.  
  49. }
  50. else if (month=="June" || month=="September")
  51. {
  52. studioPrice = 75.20;
  53. apartmentPrice = 68.70;
  54. if (stay>14)
  55. {
  56. studioPrice -= 0.20 * studioPrice;
  57. apartmentPrice -= 0.10 * apartmentPrice;
  58. fullStayApartment = stay * apartmentPrice;
  59. fullStayStudio = stay * studioPrice;
  60. Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
  61. Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
  62. }
  63. else
  64. {
  65. fullStayApartment = stay * apartmentPrice;
  66. fullStayStudio = stay * studioPrice;
  67. Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
  68. Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
  69. }
  70.  
  71.  
  72. }
  73. else if (month=="July" || month=="August")
  74. {
  75. apartmentPrice = 77;
  76. studioPrice = 76;
  77. if (stay>14)
  78. {
  79. apartmentPrice -= 0.10 * apartmentPrice;
  80. fullStayApartment = stay * apartmentPrice;
  81. fullStayStudio = stay * studioPrice;
  82. Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
  83. Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
  84. }
  85. else
  86. {
  87. fullStayApartment = stay * apartmentPrice;
  88. fullStayStudio = stay * studioPrice;
  89. Console.WriteLine($"Apartment: {fullStayApartment:f2} lv.");
  90. Console.WriteLine($"Studio: {fullStayStudio:f2} lv.");
  91. }
  92. }
  93. }
  94. }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement