f0rc3ful

04. Toy Store

Mar 25th, 2023
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. using System;
  2.  
  3. namespace HelloSoftUni
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double trip = double.Parse(Console.ReadLine());
  10. int puzzles = int.Parse(Console.ReadLine());
  11. int talkingDoll = int.Parse(Console.ReadLine());
  12. int teddyBear = int.Parse(Console.ReadLine());
  13. int minions = int.Parse(Console.ReadLine());
  14. int miniTruck = int.Parse(Console.ReadLine());
  15. double cost = puzzles * 2.6 + talkingDoll * 3 + teddyBear * 4.1 + minions * 8.2 + miniTruck * 2;
  16. if (talkingDoll + teddyBear + minions + miniTruck >= 50)
  17. { cost = cost * 0.75; }
  18. double pseudoProfit = cost * 0.9; ;
  19. if (pseudoProfit >= trip)
  20. {
  21. Console.WriteLine($"Yes! {(pseudoProfit - trip):F2} lv left.");
  22. }
  23. else
  24. {
  25. Console.WriteLine($"Not enough money! {(trip - pseudoProfit):F2} lv needed.");
  26. }
  27. }
  28. }
  29. }
  30.  
Advertisement
Add Comment
Please, Sign In to add comment