Advertisement
Guest User

Untitled

a guest
Sep 19th, 2018
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Toy_Store
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double tripPrice = double.Parse(Console.ReadLine());
  10.  
  11. int puzzelsQ = int.Parse(Console.ReadLine());
  12. int dollsQ = int.Parse(Console.ReadLine());
  13. int bearsQ = int.Parse(Console.ReadLine());
  14. int minionsQ = int.Parse(Console.ReadLine());
  15. int tracksQ = int.Parse(Console.ReadLine());
  16. double totalQ = puzzelsQ + dollsQ + bearsQ + minionsQ + tracksQ + tracksQ;
  17.  
  18. double priceP = 2.60;
  19. double priceD = 3.00;
  20. double priceB = 4.10;
  21. double priceM = 8.20;
  22. double priceT = 2.00;
  23.  
  24. double totalAmount = puzzelsQ * priceP + dollsQ * priceD + bearsQ * priceB + minionsQ * priceM + tracksQ * priceT;
  25. double rent = totalAmount * 0.10;
  26. double Proffit = totalAmount - (tripPrice + rent);
  27. double Lost = (tripPrice + rent) - totalAmount;
  28.  
  29. if (Proffit >= 0)
  30. {
  31. if (totalQ >= 50 )
  32. {
  33. double amountN = totalAmount * 0.75;
  34. double rentN = amountN * 0.10;
  35. double proffit = amountN - (tripPrice + rentN);
  36.  
  37. Console.WriteLine($"Yes! {proffit:f2} lv left.");
  38. }
  39. else
  40. {
  41. Console.WriteLine($"Yes! {Proffit:f2} lv left.");
  42. }
  43. }
  44. else if (Lost > 0)
  45. {
  46. if (totalQ >= 50)
  47. {
  48. double amountN = totalAmount * 0.75;
  49. double rentN = amountN * 0.10;
  50. double lostN = (tripPrice + rentN) - amountN;
  51. Console.WriteLine($"Not enough money! {lostN:f2} lv needed.");
  52. }
  53. else
  54. {
  55. Console.WriteLine($"Not enough money! {Lost:f2} lv needed.");
  56. }
  57. }
  58.  
  59.  
  60.  
  61.  
  62.  
  63.  
  64.  
  65. }
  66. }
  67. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement