Advertisement
kzborisov

Untitled

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