Advertisement
em3ata

ToyShop

Jul 29th, 2019
196
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.45 KB | None | 0 0
  1. using System;
  2.  
  3. namespace toyShop
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double tripPrice = double.Parse(Console.ReadLine());
  10. int puzzleCount = int.Parse(Console.ReadLine());
  11. int dollsCount = int.Parse(Console.ReadLine());
  12. int bearsCount = int.Parse(Console.ReadLine());
  13. int minionsCount = int.Parse(Console.ReadLine());
  14. int trucksCount = int.Parse(Console.ReadLine());
  15.  
  16. double puzzlePrice = 2.60;
  17. int dollsPrice = 3;
  18. double bearsPrice = 4.10;
  19. double minionsPrice = 8.20;
  20. int trucksPrice = 2;
  21. double rent = 0.10;
  22.  
  23. double sum = (puzzleCount * puzzlePrice) + (dollsCount * dollsPrice) + (bearsCount * bearsPrice) + (minionsCount * minionsPrice) + (trucksCount * trucksPrice);
  24.  
  25.  
  26. if (puzzleCount + dollsCount + bearsCount + minionsCount + trucksCount >= 50)
  27. {
  28. double discount = 0.25;
  29. double totalSum = sum - (sum * discount);
  30. double rentSum = totalSum - (totalSum * rent);
  31. Console.WriteLine($"Yes! {rentSum - tripPrice:F2} lv left.");
  32. }
  33.  
  34. else
  35. {
  36. double totalSum = sum - (sum * rent);
  37. Console.WriteLine($"Not enough money! {tripPrice - totalSum:F2} lv needed.");
  38. }
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement