Advertisement
IvanITD

05.GodzillaVsKong

Jan 15th, 2024
663
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.95 KB | Source Code | 0 0
  1. double movieBudget = double.Parse(Console.ReadLine());
  2. int peopleAmount = int.Parse(Console.ReadLine());
  3. double clothingPricePerOnePerson = double.Parse(Console.ReadLine());
  4.  
  5. double decorationPrice = movieBudget * 0.10;
  6. double clothingPrice = peopleAmount * clothingPricePerOnePerson;
  7.  
  8. double discountforClothing = 0.0;
  9.  
  10. if (peopleAmount > 150)
  11. {
  12.     discountforClothing = clothingPrice * 0.10;
  13. }
  14.  
  15. double totalClothing = clothingPrice - discountforClothing;
  16.  
  17. double totalPrice = decorationPrice + totalClothing;
  18.  
  19.  
  20. double neededMoney = movieBudget - totalPrice;
  21. double remainingMoney = totalPrice - movieBudget;
  22.  
  23.  
  24. if (totalPrice > movieBudget)
  25. {
  26.     Console.WriteLine("Not enough money!");
  27.     Console.WriteLine($"Wingard needs {Math.Abs(neededMoney):F2} leva more.");
  28. }
  29. else if (totalPrice <= movieBudget)
  30. {
  31.     Console.WriteLine("Action!");
  32.     Console.WriteLine($"Wingard starts filming with {Math.Abs(remainingMoney):F2} leva left.");
  33. }
  34.  
Tags: C#
Advertisement
Comments
Add Comment
Please, Sign In to add comment
Advertisement