Advertisement
chesten5139

06.04 HotelTests

Sep 27th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 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 _04.HotelTests
  8. {
  9. class HotelTests
  10. {
  11. static void Main()
  12. {
  13. string month = Console.ReadLine();
  14. int days = int.Parse(Console.ReadLine());
  15. double studioPrice = 0;
  16. double doublePrice = 0;
  17. double suitePrice = 0;
  18.  
  19. if (month == "May" || month == "October")
  20. {
  21. studioPrice = 50 * days;
  22. doublePrice = 65 * days;
  23. suitePrice = 75 * days;
  24.  
  25. if (days > 7)
  26. {
  27. studioPrice = 50 * days * 0.95;
  28. }
  29. if (month == "October" && days > 7)
  30. {
  31. studioPrice = 50 * 0.95 * (days - 1);
  32. }
  33. }
  34.  
  35. if (month == "June" || month == "September")
  36. {
  37. studioPrice = 60 * days;
  38. doublePrice = 72 * days;
  39. suitePrice = 82 * days;
  40.  
  41. if (days > 14)
  42. {
  43. doublePrice = 72 * days * 0.90;
  44. }
  45. if (month == "September" && days > 7)
  46. {
  47. studioPrice = 60 * (days - 1);
  48. }
  49. }
  50.  
  51. if (month == "July" || month == "August" || month == "December")
  52. {
  53. studioPrice = 68 * days;
  54. doublePrice = 77 * days;
  55. suitePrice = 89 * days;
  56.  
  57. if (days > 14)
  58. {
  59. suitePrice = 89 * days * 0.85;
  60. }
  61. }
  62.  
  63. Console.WriteLine("Studio: {0:f2} lv.", studioPrice);
  64. Console.WriteLine("Double: {0:f2} lv.", doublePrice);
  65. Console.WriteLine("Suite: {0:f2} lv.", suitePrice);
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement