kzborisov

Untitled

Oct 28th, 2018
190
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.67 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 Fishing_Boat
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double groupBudget = double.Parse(Console.ReadLine());
  14. string season = Console.ReadLine();
  15. int fishermansCount = int.Parse(Console.ReadLine());
  16.  
  17. var springRent = 3000.0;
  18. var summerAndFallRent = 4200.0;
  19. var winterRent = 2600.0;
  20.  
  21. var totalSum = 0.0;
  22. if (season == "Spring")
  23. {
  24. totalSum = 3000.0;
  25. if (fishermansCount <= 6)
  26. {
  27. totalSum -= totalSum * 0.1;
  28. }
  29. else if (fishermansCount > 6 && fishermansCount <= 11)
  30. {
  31. totalSum -= totalSum * 0.15;
  32. }
  33. else if (fishermansCount >= 12)
  34. {
  35. totalSum -= totalSum * 0.25;
  36. }
  37. }
  38. else if (season == "Summer" || season == "Autumn")
  39. {
  40. totalSum = 4200.0;
  41. if (fishermansCount <= 6)
  42. {
  43. totalSum -= totalSum * 0.1;
  44. }
  45. else if (fishermansCount > 6 && fishermansCount <= 11)
  46. {
  47. totalSum -= totalSum * 0.15;
  48. }
  49. else if (fishermansCount >= 12)
  50. {
  51. totalSum -= totalSum * 0.25;
  52. }
  53. }
  54. else if (season == "Winter")
  55. {
  56. totalSum = 2600.0;
  57. if (fishermansCount <= 6)
  58. {
  59. totalSum -= totalSum * 0.1;
  60. }
  61. else if (fishermansCount > 6 && fishermansCount <= 11)
  62. {
  63. totalSum -= totalSum * 0.15;
  64. }
  65. else if (fishermansCount >= 12)
  66. {
  67. totalSum -= totalSum * 0.25;
  68. }
  69. }
  70.  
  71. if (fishermansCount % 2 == 0 && season != "Autumn")
  72. {
  73. totalSum -= totalSum * 0.05;
  74. }
  75.  
  76. if (groupBudget >= totalSum)
  77. {
  78. Console.WriteLine($"Yes! You have {groupBudget - totalSum:F2} leva left.");
  79. }
  80. else if (groupBudget < totalSum)
  81. {
  82. Console.WriteLine($"Not enough money! You need {totalSum - groupBudget:F2} leva.");
  83. }
  84.  
  85. }
  86. }
  87. }
Add Comment
Please, Sign In to add comment