Advertisement
desislava_topuzakova

06. Godzilla vs. Kong

Jun 14th, 2021
923
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.78 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _06.GodzillaVsKong
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)        
  8.         {   //вход
  9.             //декор = 10% от бюджета = 0.1 * бюджета - OK
  10.             //облекло = бр. статистите * цена за облекло на 1 статист - OK
  11.             //проверка дали имам отстъпка -> бр. стат > 150 -> обекло - 10% - OK
  12.             //разходи = декор + облекло
  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 decorPrice = 0.1 * budget;
  20.             double clothesPrice = countStatists * pricePerStatist;
  21.  
  22.             if (countStatists > 150)
  23.             {
  24.                 clothesPrice = clothesPrice - 0.10 * clothesPrice; //0.9 * clothesPrice
  25.             }
  26.  
  27.             double expenses = decorPrice + clothesPrice;
  28.  
  29.  
  30.             //ако бюджетът е достатъчен -> бюджетът >= разходите
  31.             if (budget >= expenses)
  32.             {
  33.                 Console.WriteLine("Action!");
  34.                 double leftMoney = budget - expenses;
  35.                 Console.WriteLine($"Wingard starts filming with {leftMoney:F2} leva left.");
  36.             }
  37.             else //budget < expenses
  38.             {
  39.                 Console.WriteLine("Not enough money!");
  40.                 double needMoney = expenses - budget;
  41.                 Console.WriteLine($"Wingard needs {needMoney:F2} leva more.");
  42.             }
  43.  
  44.  
  45.  
  46.  
  47.  
  48.  
  49.  
  50.         }
  51.     }
  52. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement