Advertisement
Bubeto

Untitled

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