Advertisement
Guest User

GodzillaVsKong

a guest
Sep 21st, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.31 KB | None | 0 0
  1. using System;
  2.  
  3. namespace GodzillavsKong
  4. {
  5.     class MainClass
  6.     {
  7.         public static void Main(string[] args)
  8.         {
  9.             //input
  10.             double budget = double.Parse(Console.ReadLine());
  11.             int extra = int.Parse(Console.ReadLine());
  12.             double outfitPrice = double.Parse(Console.ReadLine());
  13.  
  14.             //film decor 10% from budget
  15.             //more than 150 extras, outfits are 10% off
  16.             double decor = budget * 0.10;
  17.  
  18.  
  19.             if (extra >= 150)
  20.             {
  21.                 outfitPrice = outfitPrice - (outfitPrice * 0.10);
  22.             }
  23.             else
  24.             {
  25.                
  26.             }
  27.  
  28.             double outfitSum = extra * outfitPrice;
  29.  
  30.             if (budget >= decor + outfitSum)
  31.             {
  32.                 Console.WriteLine("Action!");
  33.                 double budgetLeft = budget - (decor + outfitSum);
  34.                 Console.WriteLine($"Wingard starts filming with {budgetLeft:F2} leva left.");
  35.             }
  36.             if (budget < decor + outfitSum)
  37.             {
  38.                 Console.WriteLine("Not enough money!");
  39.                 double budgetLeft = Math.Abs(budget - (decor + outfitSum));
  40.                 Console.WriteLine($"Wingard needs {budgetLeft:F2} leva more.");
  41.             }
  42.  
  43.         }
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement