Viktomirova

ToyShop

Apr 23rd, 2020
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.02 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. double grandtotal = double.Parse($"{total:f2}");
  25. Console.WriteLine("Yes! " + grandtotal + " lv left.");
  26. }
  27. else
  28. {
  29. double total = priceTrip - profit;
  30. double grandtotal = double.Parse($"{total:f2}");
  31. Console.WriteLine("Not enough money! " + grandtotal + " lv needed.");
  32. }
  33. }
  34. else
  35. {
  36. double profit = priceOrder * 0.90;
  37. if (profit > priceTrip)
  38. {
  39. double total = profit - priceTrip;
  40. double grandtotal = double.Parse($"{total:f2}");
  41. Console.WriteLine("Yes! " + grandtotal + " lv left.");
  42. }
  43. else
  44. {
  45. double total = priceTrip - profit;
  46. double grandtotal = double.Parse($"{total:f2}");
  47. Console.WriteLine("Not enough money! " + grandtotal + " lv needed.");
  48. }
  49. }
  50. }
  51. }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment