IvetValcheva

Godzilla vs. Kong

Apr 12th, 2021
250
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.21 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Ex._2
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             //Декорът = 10% от бюджета.
  10.             //статиста>150 -> отстъпка за облеклото =-10 %.
  11.  
  12.             double budget = double.Parse(Console.ReadLine());
  13.             int extras = int.Parse(Console.ReadLine());
  14.             double clothingPrice = double.Parse(Console.ReadLine());
  15.  
  16.             double decor = budget * 10 / 100;
  17.             double clothingMoney = extras * clothingPrice;
  18.  
  19.             if (extras > 150)
  20.             {
  21.                 clothingMoney = clothingMoney - clothingMoney * 10 / 100;
  22.             }
  23.  
  24.             double difference = budget - (clothingMoney + decor);
  25.  
  26.             if (difference>=0)
  27.             {
  28.                 Console.WriteLine("Action!");
  29.                 Console.WriteLine($"Wingard starts filming with {difference:F2} leva left.");
  30.             }
  31.             else
  32.             {
  33.                 difference = Math.Abs(difference);
  34.                 Console.WriteLine("Not enough money!");
  35.                 Console.WriteLine($"Wingard needs {difference:F2} leva more.");
  36.             }
  37.  
  38.         }
  39.     }
  40. }
  41.  
Advertisement
Add Comment
Please, Sign In to add comment