Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _10.SkiTrip
  4. {
  5. class SkiTrip
  6. {
  7. static void Main(string[] args)
  8. {
  9. int days = int.Parse(Console.ReadLine());
  10. string roomType = Console.ReadLine();
  11. string feedback = Console.ReadLine();
  12.  
  13. int nights = days - 1;
  14.  
  15. double sumNights = 0;
  16.  
  17. if (roomType == "room for one person")
  18. {
  19. sumNights = 18 * nights;
  20. }
  21. else if ( roomType == "apartment")
  22. {
  23. if (nights < 10)
  24. {
  25. sumNights = (25 * nights) * 0.7;
  26. }
  27. else if (nights >= 10 && nights <= 15)
  28. {
  29. sumNights = (25 * nights) * 0.65;
  30. }
  31. else if (nights > 15)
  32. {
  33. sumNights = (25 * nights) * 0.5;
  34. }
  35. }
  36. else if (roomType == "president apartment")
  37. {
  38. if (nights < 10)
  39. {
  40. sumNights = (35 * nights) * 0.9;
  41. }
  42. else if (nights >= 10 && nights <= 15)
  43. {
  44. sumNights = (35 * nights) * 0.85;
  45. }
  46. else if (nights > 15)
  47. {
  48. sumNights = (35 * nights) * 0.8;
  49. }
  50. }
  51.  
  52. if (feedback == "positive")
  53. {
  54. sumNights = sumNights * 1.25; // *=
  55. }
  56. else if (feedback == "negative")
  57. {
  58. sumNights = sumNights * 0.9;
  59. }
  60.  
  61. Console.WriteLine($"{sumNights:f2}");
  62.  
  63. }
  64. }
  65. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement