ahmed_so

Untitled

Feb 27th, 2020
150
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 _05._Fishing_Boat
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int budgetGroup = int.Parse(Console.ReadLine());
  10. string season = Console.ReadLine();
  11. int countFihers = int.Parse(Console.ReadLine());
  12.  
  13. double priceShip = 0;
  14.  
  15. switch (season)
  16. {
  17. case "Spring":
  18. priceShip = 3000;
  19. break;
  20. case "Summer":
  21. priceShip = 4200;
  22. break;
  23. case "Autumn":
  24. priceShip = 4200;
  25. break;
  26. case "Winter":
  27. priceShip = 2600;
  28. break;
  29. }
  30.  
  31. if (countFihers <= 6)
  32. {
  33. priceShip = priceShip * 0.9;
  34. }
  35.  
  36. else if (countFihers >= 7 && countFihers <= 11)
  37. {
  38. priceShip = priceShip * 0.85;
  39. }
  40.  
  41. else if (countFihers >= 12)
  42. {
  43. priceShip = priceShip * 0.75;
  44. }
  45.  
  46.  
  47. if (countFihers % 2 == 0 && season != "Autumn")
  48. {
  49. priceShip = priceShip * 0.95;
  50. }
  51.  
  52. if (budgetGroup > priceShip)
  53. {
  54. double left = budgetGroup - priceShip;
  55. Console.WriteLine($"Yes! You have {left:f2} leva left.");
  56. }
  57. else if (budgetGroup < priceShip)
  58. {
  59. double need = priceShip - budgetGroup;
  60. Console.WriteLine($"Not enough money! You need {need:f2} leva.");
  61.  
  62. }
  63.  
  64.  
  65.  
  66. }
  67. }
  68. }
Advertisement
Add Comment
Please, Sign In to add comment