miroslavbstoyanov

Untitled

Feb 2nd, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.83 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 HotelRooms
  8. {
  9. class HotelRooms
  10. {
  11. static void Main(string[] args)
  12. {
  13. var mounth = Console.ReadLine();
  14. var number = int.Parse(Console.ReadLine());
  15. var studio = 0.00;
  16. var apartment = 0.00;
  17. var discount = 0.00;
  18. var discouthotel = 0.00;
  19.  
  20. if (mounth == "May" || mounth == "October")
  21. {
  22. studio = 50;
  23. apartment = 65;
  24. if (number > 7 && number <= 14)
  25. {
  26. discount = 0.05;
  27. }
  28. else if (number > 14)
  29. {
  30. discount = 0.30;
  31. }
  32.  
  33. }
  34. else if (mounth == "June" || mounth == "September")
  35. {
  36. studio = 75.20;
  37. apartment = 68.70;
  38. if (number > 14)
  39. {
  40. discount = 0.20;
  41. }
  42.  
  43. }
  44. else if ((mounth == "July" || mounth == "August"))
  45. {
  46. studio = 76;
  47. apartment = 77;
  48. }
  49.  
  50. if (apartment != 0 && number > 14)
  51. {
  52. discouthotel = 0.10;
  53. }
  54.  
  55. var pricestudio = number * studio;
  56. var pricejhotel = number * apartment;
  57. var discstudio = pricestudio * discount;
  58. var dischotel = pricejhotel * discouthotel;
  59. var stud = pricestudio - discstudio;
  60. var apart = pricejhotel - dischotel;
  61. Console.WriteLine($"Apartment: {apart:f2} lv.");
  62. Console.WriteLine($"Studio: {stud:f2} lv.");
  63.  
  64. }
  65. }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment