Advertisement
desislava_topuzakova

06. Godzilla vs. Kong

Apr 26th, 2020
532
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.64 KB | None | 0 0
  1. using System;
  2.  
  3. namespace demo
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //разходи -> декор и обекла
  10.             //декор = 10% от бюджета
  11.             //обекла = бр. статисти * ед. цена за костюм
  12.             //проверка дали има отстъпка - 10%
  13.             //разходи = декор + обекла
  14.             //проверка дали бюджета стига да покрие разходите
  15.             double budget = double.Parse(Console.ReadLine());
  16.             int countStatists = int.Parse(Console.ReadLine());
  17.             double pricePerStatist = double.Parse(Console.ReadLine());
  18.  
  19.             double decor = 0.10 * budget;
  20.             double clothes = countStatists * pricePerStatist;
  21.  
  22.             if (countStatists > 150)
  23.             {
  24.                 clothes = clothes - 0.10 * clothes; //0.9 * clothes
  25.             }
  26.  
  27.             double expenses = decor + clothes;
  28.  
  29.             //1. да му стигнат парите
  30.             if(budget >= expenses)
  31.             {
  32.                 Console.WriteLine("Action!");
  33.                 double leftMoney = budget - expenses;
  34.                 Console.WriteLine($"Wingard starts filming with {leftMoney:F2} leva left.");
  35.             }//2. парите не му стигат budget < expenses
  36.             else
  37.             {
  38.                 Console.WriteLine("Not enough money!");
  39.                 double needMoney = expenses - budget;
  40.                 Console.WriteLine($"Wingard needs {needMoney:F2} leva more.");
  41.             }
  42.  
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement