Advertisement
rado8506

02. New Years Eve Party

Jan 26th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp6
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int numberguests = int.Parse(Console.ReadLine());
  14.             int budget = int.Parse(Console.ReadLine());
  15.             int kuvert = 20;
  16.             double kuvertAmount = numberguests * kuvert;
  17.             double moneyLeft = budget - kuvertAmount;
  18.             double moneyFire = moneyLeft * 0.4;
  19.             double moneyCharity = moneyLeft - moneyFire;
  20.  
  21.             if (budget > kuvertAmount)
  22.             {
  23.                 Console.WriteLine("Yes! {0} lv are for fireworks and {1} lv are for donation.", Math.Round(moneyFire), Math.Round(moneyCharity));
  24.             }
  25.             else if (budget <= kuvertAmount)
  26.             {
  27.                 Console.WriteLine("They won't have enough money to pay the covert. They will need {0} lv more.", Math.Abs(Math.Round(moneyLeft)));
  28.             }
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement