Advertisement
krasi1105

Flower Shop

Feb 26th, 2017
134
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 cast_test
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             double magPrice = int.Parse(Console.ReadLine()) * 3.25;
  14.             int hyacinthPrice = int.Parse(Console.ReadLine()) * 4;
  15.             double rosePrice = int.Parse(Console.ReadLine()) * 3.5;
  16.             int cactPrice = int.Parse(Console.ReadLine()) * 8;
  17.             double neededMoney = double.Parse(Console.ReadLine());
  18.  
  19.             double profit = (magPrice + rosePrice + hyacinthPrice + cactPrice) * 0.95;
  20.             if (neededMoney <= profit)
  21.                 Console.WriteLine("She is left with {0} leva.", Math.Floor(profit - neededMoney));
  22.             else
  23.                 Console.WriteLine("She will have to borrow {0} leva.", Math.Ceiling(neededMoney - profit));
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement