IvetValcheva

05. Godzilla vs. Kong

Nov 7th, 2021
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.09 KB | None | 0 0
  1. using System;
  2.  
  3. namespace demo
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double budget = double.Parse(Console.ReadLine());
  10.             int statists = int.Parse(Console.ReadLine());
  11.             double clothingPrice = double.Parse(Console.ReadLine());
  12.  
  13.             double decor = budget * 0.10; //done
  14.             double clothing = statists * clothingPrice;
  15.  
  16.             if (statists >= 150)
  17.             {
  18.                 clothing = clothing - clothing * 0.1;
  19.             }
  20.  
  21.             double neededMoney = clothing + decor;
  22.  
  23.             double difference = budget - neededMoney;
  24.  
  25.             if (difference>=0)
  26.             {
  27.                 Console.WriteLine("Action!");
  28.                 Console.WriteLine($"Wingard starts filming with {difference:F2} leva left.");
  29.             }
  30.             else
  31.             {
  32.                 difference = Math.Abs(difference);
  33.                 Console.WriteLine("Not enough money!");
  34.                 Console.WriteLine($"Wingard needs {difference:F2} leva more.");
  35.             }
  36.  
  37.         }
  38.     }
  39. }
  40.  
Advertisement
Add Comment
Please, Sign In to add comment