Advertisement
Guest User

Untitled

a guest
Mar 29th, 2020
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.48 KB | None | 0 0
  1. using System;
  2.  
  3. namespace fishingBoat
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int budget = int.Parse(Console.ReadLine());
  10. string season = Console.ReadLine();
  11. int people = int.Parse(Console.ReadLine());
  12. double rent = 0;
  13.  
  14. switch (season)
  15. {
  16. case "Spring":
  17. rent = 3000;
  18. break;
  19. case "Summer":
  20. case "Autumn":
  21. rent = 4200;
  22. break;
  23. case "Winter":
  24. rent = 2600;
  25. break;
  26. }
  27. if (people <= 6)
  28. {
  29. rent *= 0.90;
  30. }
  31. else if (people >= 7 && people <= 11)
  32. {
  33. rent *= 0.85;
  34. }
  35. else if (people >= 12)
  36. {
  37. rent *= 0.75;
  38. }
  39. if (people % 2 == 0)
  40. {
  41. if (season == "Winter" || season == "Summer" || season == "Spring")
  42. {
  43. rent *= 0.95;
  44. }
  45. }
  46. if (budget <= rent)
  47. {
  48. Console.WriteLine($"Not enough money! You need {rent - budget:f2} leva.");
  49. }
  50. else
  51. {
  52. Console.WriteLine($"Yes! You have {budget - rent:F2} leva left.");
  53. }
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement