Viktomirova

Untitled

Apr 23rd, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.72 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 priceTrip = double.Parse(Console.ReadLine());
  10. int puzzles = int.Parse(Console.ReadLine());
  11. int dolls = int.Parse(Console.ReadLine());
  12. int teddybears = int.Parse(Console.ReadLine());
  13. int minions = int.Parse(Console.ReadLine());
  14. int trucks = int.Parse(Console.ReadLine());
  15. double priceOrder = (puzzles * 2.60 + dolls * 3 + teddybears * 4.10 + minions * 8.20 + trucks * 2);
  16. int numberToys = (puzzles + dolls + teddybears + minions + trucks);
  17. if (numberToys >= 50)
  18. {
  19. double Price = priceOrder * 0.75;
  20. double profit = Price * 0.90;
  21. if (profit > priceTrip)
  22. {
  23. double total = profit - priceTrip;
  24. Console.WriteLine($"Yes! {total:f2} lv left.");
  25. }
  26. else
  27. {
  28. double total = priceTrip - profit;
  29. Console.WriteLine($"Not enough money! {total:f2} lv needed.");
  30. }
  31. }
  32. else
  33. {
  34. double profit = priceOrder * 0.90;
  35. if (profit > priceTrip)
  36. {
  37. double total = profit - priceTrip;
  38. Console.WriteLine($"Yes! {total:f2} lv left.");
  39. }
  40. else
  41. {
  42. double total = priceTrip - profit;
  43. Console.WriteLine($"Not enough money! {total:f2} lv needed.");
  44. }
  45. }
  46. }
  47. }
  48. }
Advertisement
Add Comment
Please, Sign In to add comment