Advertisement
Pretorianbg

Untitled

Oct 1st, 2018
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 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. int budget = int.Parse(Console.ReadLine());
  14. string season = Console.ReadLine();
  15. int fisherman = int.Parse(Console.ReadLine());
  16. double boatrent = 0;
  17.  
  18. if (season == "Spring") boatrent = 3000;
  19. else if (season == "Summer" || season=="Autumn") boatrent = 4200;
  20. else if (season == "Winter") boatrent = 2600;
  21.  
  22. if (fisherman <= 6) boatrent = boatrent * 0.9;
  23. else if (fisherman >= 7 && fisherman<=11) boatrent = boatrent * 0.85;
  24. else if (fisherman >= 12) boatrent = boatrent * 0.75;
  25.  
  26. if (fisherman % 2 == 0 && season!="Autumn") boatrent = boatrent * 0.95;
  27.  
  28. if (budget<=boatrent)
  29. {
  30. Console.WriteLine($"Not enough money! You need {(boatrent-budget):F2} leva.");
  31. }
  32. else
  33. {
  34. Console.WriteLine($"Yes! You have {(budget-boatrent):F2} leva left.");
  35. }
  36. }
  37. }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement