Advertisement
nevenailievaa

05.GodzillaVsKong

Nov 10th, 2024
140
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.80 KB | None | 0 0
  1. //Input
  2. double movieBudget = double.Parse(Console.ReadLine());
  3. int actorsCount = int.Parse(Console.ReadLine());
  4. double actorClothingPrice = double.Parse(Console.ReadLine());
  5.  
  6. //Calculations
  7. double decorPrice = movieBudget * 0.1;
  8. double actorsClothingBill = actorsCount * actorClothingPrice;
  9.  
  10. if (actorsCount > 150)
  11. {
  12.     actorsClothingBill = actorsClothingBill * 0.9;
  13. }
  14.  
  15. double bill = decorPrice + actorsClothingBill;
  16.  
  17. //Output
  18. if (bill > movieBudget)
  19. {
  20.     double neededMoney = bill - movieBudget;
  21.     Console.WriteLine("Not enough money!");
  22.     Console.WriteLine($"Wingard needs {neededMoney:f2} leva more.");
  23. }
  24. else
  25. {
  26.     double remainingMoney = movieBudget - bill;
  27.     Console.WriteLine("Action!");
  28.     Console.WriteLine($"Wingard starts filming with {remainingMoney:f2} leva left.");
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement