Advertisement
Bubeto

Untitled

Jan 30th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.30 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 ConsoleApp1
  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 fisherCount = int.Parse(Console.ReadLine());
  16. double rent = 0;
  17. double finalRent = 0;
  18.  
  19. if (season == "Spring")
  20. {
  21. rent = 3000;
  22. if (fisherCount <= 6)
  23. {
  24. finalRent = rent - (0.1 * rent);
  25. }
  26. else if (fisherCount >= 7 && fisherCount <= 11)
  27. {
  28. finalRent = rent - (0.15 * rent);
  29. }
  30. else if (fisherCount >= 12)
  31. {
  32. finalRent = rent - (0.25 * rent);
  33. }
  34.  
  35. }
  36.  
  37. else if (season == "Summer")
  38. {
  39. rent = 4200;
  40. if (fisherCount <= 6)
  41. {
  42. finalRent = rent - (0.1 * rent);
  43. }
  44. else if (fisherCount >= 7 && fisherCount <= 11)
  45. {
  46. finalRent = rent - (0.15 * rent);
  47. }
  48. else if (fisherCount >= 12)
  49. {
  50. finalRent = rent - (0.25 * rent);
  51. }
  52.  
  53. }
  54.  
  55. else if (season == "Autumn")
  56. {
  57. rent = 4200;
  58. if (fisherCount <= 6)
  59. {
  60. finalRent = rent - (0.1 * rent);
  61. }
  62. else if (fisherCount >= 7 && fisherCount <= 11)
  63. {
  64. finalRent = rent - (0.15 * rent);
  65. }
  66. else if (fisherCount >= 12)
  67. {
  68. finalRent = rent - (0.25 * rent);
  69. }
  70.  
  71.  
  72. }
  73.  
  74. else if (season == "Winter")
  75. {
  76. rent = 2600;
  77. if (fisherCount <= 6)
  78. {
  79. finalRent = rent - (0.1 * rent);
  80. }
  81. else if (fisherCount >= 7 && fisherCount <= 11)
  82. {
  83. finalRent = rent - (0.15 * rent);
  84. }
  85. else if (fisherCount >= 12)
  86. {
  87. finalRent = rent - (0.25 * rent);
  88. }
  89.  
  90. }
  91. else { }
  92.  
  93. if (fisherCount % 2 == 0 && season != "Autumn")
  94. {
  95. finalRent = finalRent - (finalRent*0.05);
  96. }
  97. else
  98. {
  99.  
  100. }
  101. if (groupBudget > finalRent)
  102. {
  103. double moneyLeave = groupBudget - finalRent;
  104.  
  105. Console.WriteLine($"Yes! You have {moneyLeave:F2} leva left.");
  106. }
  107. else
  108. {
  109. double moneyNeed = finalRent - groupBudget;
  110. Console.WriteLine($"Not enough money! You need {moneyNeed:F2} leva.");
  111. }
  112.  
  113. }
  114. }
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement