VickSuna

Untitled

Feb 26th, 2020
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _425_Fishing_Boat
  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 fishermans = int.Parse(Console.ReadLine());
  12.  
  13. double price = 0;
  14.  
  15. switch (season)
  16. {
  17. case "Spring":
  18. price = 3000;
  19. break;
  20. case "Summer":
  21. price = 4200;
  22. break;
  23. case "Autumn":
  24. price = 4200;
  25. break;
  26. case "Winter":
  27. price = 2600;
  28. break;
  29. }
  30.  
  31. if (fishermans <= 6)
  32. {
  33. price = price * 0.90;
  34. }
  35. else if (fishermans >= 7 && fishermans <= 11)
  36. {
  37. price = price * 0.85;
  38. }
  39. else if (fishermans >= 12)
  40. {
  41. price = price * 0.75;
  42. }
  43.  
  44. if (season != "Autumn" && fishermans * 1.0 % 2 == 0)
  45. {
  46. price = price * 0.95;
  47. }
  48.  
  49.  
  50.  
  51. if (budget >= price)
  52. {
  53. Console.WriteLine($"Yes! You have {budget - price:F2} leva left.");
  54. }
  55. else if (price > budget)
  56. {
  57. Console.WriteLine($"Not enough money! You need {price - budget:F2} leva.");
  58. }
  59.  
  60.  
  61.  
  62. }
  63. }
  64. }
Add Comment
Please, Sign In to add comment