SvetlanPetrova

GodzillaVsKong

Apr 8th, 2019
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.15 KB | None | 0 0
  1. using System;
  2.  
  3. namespace GodzillaVsKong
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double budget = double.Parse(Console.ReadLine());
  10.             int actors = int.Parse(Console.ReadLine());
  11.             double clothesPerActor = double.Parse(Console.ReadLine());
  12.  
  13.             double decore = budget * 0.10;
  14.             double totalClothes = 0;
  15.  
  16.             if (actors <= 150)
  17.             {
  18.                 totalClothes = actors * clothesPerActor;
  19.             }
  20.             else if (actors > 150)
  21.             {
  22.                 totalClothes = actors * clothesPerActor * 0.90;
  23.             }
  24.  
  25.             double totalCost = decore + totalClothes;
  26.  
  27.             if (totalCost > budget)
  28.             {
  29.                 Console.WriteLine("Not enough money!");
  30.                 Console.WriteLine($"Wingard needs {(totalCost - budget):f2} leva more.");
  31.             }
  32.  
  33.             else if (totalCost <= budget)
  34.             {
  35.                 Console.WriteLine("Action!");
  36.                 Console.WriteLine($"Wingard starts filming with {(budget - totalCost):f2} leva left.");
  37.             }
  38.  
  39.         }
  40.     }
  41. }
Add Comment
Please, Sign In to add comment