krasi1105

Flower-Shop

Feb 26th, 2017
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.89 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 FlowerShop
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             int M = int.Parse(Console.ReadLine());
  14.             int Z = int.Parse(Console.ReadLine());
  15.             int R = int.Parse(Console.ReadLine());
  16.             int K = int.Parse(Console.ReadLine());
  17.             double price = double.Parse(Console.ReadLine());
  18.  
  19.  
  20.             double pari = M * 3.25 + Z * 4 + R * 3.5 + K * 8;
  21.             pari = pari - (pari * 0.05);
  22.  
  23.             if (price <= pari)
  24.             {
  25.                 Console.WriteLine("She is left with {0} leva.", Math.Floor(pari - price));
  26.             }
  27.             else if (pari < price)
  28.             {
  29.                 Console.WriteLine("She will have to borrow {0} leva.", Math.Ceiling(price - pari));
  30.             }
  31.         }
  32.     }
  33. }
Advertisement
Add Comment
Please, Sign In to add comment