Advertisement
social1986

Untitled

Jun 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 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 Flower_Shop
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int magnolii = int.Parse(Console.ReadLine());
  14. int ziumbiuli = int.Parse(Console.ReadLine());
  15. int roses = int.Parse(Console.ReadLine());
  16. int kaktus = int.Parse(Console.ReadLine());
  17. double presentPrice = double.Parse(Console.ReadLine());
  18.  
  19. double totalProfit = (magnolii * 3.25 + ziumbiuli * 4 + roses * 3.50 + kaktus * 8) - ((magnolii * 3.25 + ziumbiuli * 4 + roses * 3.50 + kaktus * 8)* 0.05);
  20. double diff = Math.Abs(presentPrice - totalProfit);
  21.  
  22. if (presentPrice <= totalProfit)
  23. {
  24. diff = Math.Floor(diff);
  25. Console.WriteLine($"She is left with {diff} leva.");
  26. }
  27. else
  28. {
  29. diff = Math.Ceiling(diff);
  30. Console.WriteLine($"She will have to borrow {diff} leva.");
  31. }
  32.  
  33. }
  34. }
  35. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement