Advertisement
Daniel_007

02. Bracelet Stand

Nov 2nd, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.75 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Exam
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             double moneyPocket = double.Parse(Console.ReadLine());
  10.             double moneyWin = double.Parse(Console.ReadLine());
  11.             double moneyExpense = double.Parse(Console.ReadLine());
  12.             double pricePresent = double.Parse(Console.ReadLine());
  13.             double all = (moneyPocket + moneyWin) * 5 - moneyExpense;
  14.             if (pricePresent > all)
  15.             {
  16.                 Console.WriteLine($"Insufficient money: {pricePresent-all:F2} BGN.");
  17.             }
  18.             else
  19.             {
  20.                 Console.WriteLine($"Profit: {all:F2} BGN, the gift has been purchased.");
  21.             }
  22.         }
  23.     }
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement