Advertisement
fbinnzhivko

Untitled

Apr 15th, 2017
145
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.99 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 _2
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.  
  14.             var magnoliii = decimal.Parse(Console.ReadLine());
  15.             var zumbuli= decimal.Parse(Console.ReadLine());
  16.             var rozi = decimal.Parse(Console.ReadLine());
  17.             var kaktuzi= decimal.Parse(Console.ReadLine());
  18.             var prizeGift = decimal.Parse(Console.ReadLine());
  19.  
  20.  
  21.             var total = (magnoliii * (decimal)3.25 + zumbuli * (decimal)4 + rozi*(decimal)3.5+kaktuzi*(decimal)8)*(decimal)0.95;
  22.  
  23.             if (total < prizeGift)
  24.             {
  25.                 Console.WriteLine("She will have to borrow {0} leva. ", Math.Ceiling(prizeGift - total));
  26.             }
  27.             else
  28.             {
  29.                 Console.WriteLine("She is left with {0} leva.", Math.Floor(Math.Abs(total - prizeGift)));
  30.             }
  31.  
  32.  
  33.         }
  34.     }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement