Advertisement
milen_tasev

Untitled

Oct 22nd, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.15 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7. double excursion = double.Parse(Console.ReadLine());
  8. int puzzelsNum = int.Parse(Console.ReadLine());
  9. int dollNum = int.Parse(Console.ReadLine());
  10. int bearNum = int.Parse(Console.ReadLine());
  11. int minionNum = int.Parse(Console.ReadLine());
  12. int truckNum = int.Parse(Console.ReadLine());
  13. int toysTotal = puzzelsNum + dollNum + bearNum + minionNum + truckNum;
  14. double toysPrise = (puzzelsNum * 2.60) + (dollNum * 3) + (bearNum * 4.10) + (minionNum *8.20) + (truckNum * 2);
  15. double profit = 0;
  16. double difference = 0;
  17. if(excursion < toysPrise && toysTotal>=50)
  18. {
  19. profit = (toysPrise -0.25 * toysPrise) - (0.1 *(toysPrise -0.25 * toysPrise));
  20. difference = profit - excursion;
  21. Console.WriteLine( "Yes! {0:F2} lv left.",difference);
  22.  
  23. }
  24. else if(excursion > toysPrise)
  25. {
  26. profit = toysPrise - (0.1 * toysPrise);
  27. difference = excursion - profit;
  28. Console.WriteLine( "Not enough money! {0:F2} lv needed.",difference);
  29. }
  30. }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement