nikolayneykov

Untitled

Nov 4th, 2018
161
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. using System;
  2.  
  3. class WeddingParty
  4. {
  5.     static void Main(string[] args)
  6.     {
  7.         int guestsCount = int.Parse(Console.ReadLine());
  8.         double budget = double.Parse(Console.ReadLine());
  9.  
  10.         double guestPrice = guestsCount * 20;
  11.         if (guestPrice < budget)
  12.         {
  13.             budget -= guestPrice;
  14.             double fireworksMoney = Math.Round(budget * 0.4);
  15.             double donationMoney = Math.Round(budget - fireworksMoney);
  16.             Console.WriteLine($"Yes! {fireworksMoney} lv are for fireworks and {donationMoney} lv are for donation. ");
  17.         }
  18.         else
  19.         {
  20.             Console.WriteLine($"They won't have enough money to pay the covert. They will need {guestPrice - budget} lv more.");
  21.         }
  22.     }
  23. }
Advertisement
Add Comment
Please, Sign In to add comment