Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace demo
- {
- class Program
- {
- static void Main(string[] args)
- {
- //разходи -> декор и обекла
- //декор = 10% от бюджета
- //обекла = бр. статисти * ед. цена за костюм
- //проверка дали има отстъпка - 10%
- //разходи = декор + обекла
- //проверка дали бюджета стига да покрие разходите
- double budget = double.Parse(Console.ReadLine());
- int countStatists = int.Parse(Console.ReadLine());
- double pricePerStatist = double.Parse(Console.ReadLine());
- double decor = 0.10 * budget;
- double clothes = countStatists * pricePerStatist;
- if (countStatists > 150)
- {
- clothes = clothes - 0.10 * clothes; //0.9 * clothes
- }
- double expenses = decor + clothes;
- //1. да му стигнат парите
- if(budget >= expenses)
- {
- Console.WriteLine("Action!");
- double leftMoney = budget - expenses;
- Console.WriteLine($"Wingard starts filming with {leftMoney:F2} leva left.");
- }//2. парите не му стигат budget < expenses
- else
- {
- Console.WriteLine("Not enough money!");
- double needMoney = expenses - budget;
- Console.WriteLine($"Wingard needs {needMoney:F2} leva more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement