Advertisement
Guest User

Untitled

a guest
Nov 3rd, 2018
1,045
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.70 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. int budget = int.Parse(Console.ReadLine());
  14. string season = Console.ReadLine();
  15. int fishers = int.Parse(Console.ReadLine());
  16.  
  17. double priceShip = 0;
  18. double discount = 0;
  19.  
  20. if (season == "Spring")
  21. {
  22. priceShip = 3000;
  23. }
  24. else if (season == "Summer" || season == "Autumn")
  25. {
  26. priceShip = 4200;
  27. }
  28. else if (season == "Winter")
  29. {
  30. priceShip = 2600;
  31. }
  32. if (fishers <= 6)
  33. {
  34.  
  35. priceShip *= 0.90;
  36. }
  37. else if (fishers >= 7 && fishers <= 11)
  38. {
  39. priceShip *=0.85;
  40. }
  41. else if (fishers >= 12)
  42. {
  43. priceShip *= 0.75;
  44. }
  45. if (fishers % 2 == 0 && season != "Autumn")
  46. {
  47. priceShip *= 0.95;
  48. }
  49.  
  50. double total = priceShip;
  51. if (total > budget)
  52. {
  53. double moneyNeeded = total - budget;
  54. Console.WriteLine($"Not enough money! You need {moneyNeeded:f2} leva.");
  55. }
  56. else if (total <= budget)
  57. {
  58. double moneyLeft = budget - total;
  59. Console.WriteLine($"Yes! You have {moneyLeft:F2} leva left.");
  60. }
  61.  
  62. }
  63. }
  64. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement