Guest User

Untitled

a guest
Dec 11th, 2016
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 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 _02.Flower_Shop
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int numberOfMagnolii = int.Parse(Console.ReadLine());
  14. int numberOfZumbuli = int.Parse(Console.ReadLine());
  15. int numberOfRoses = int.Parse(Console.ReadLine());
  16. int numberOfCactuses = int.Parse(Console.ReadLine());
  17. double presentPrice = double.Parse(Console.ReadLine());
  18.  
  19. double magnoliiProfit = numberOfMagnolii * 3.25;
  20. double zumbuliProfit = numberOfZumbuli * 4.0;
  21. double rosesProfit = numberOfRoses * 3.5;
  22. double cactusesProfit = numberOfCactuses * 8.0;
  23.  
  24. double totalProfit = magnoliiProfit + zumbuliProfit + rosesProfit + cactusesProfit;
  25. double totalProfitAfterTax = totalProfit - totalProfit * 0.05;
  26.  
  27. if (totalProfitAfterTax >= presentPrice)
  28. {
  29. Console.WriteLine("She is left with {0} leva.", Math.Floor(totalProfitAfterTax - presentPrice));
  30. }
  31. else
  32. {
  33. Console.WriteLine("She will have to borrow {0} leva.", Math.Ceiling(presentPrice - totalProfitAfterTax));
  34. }
  35. }
  36. }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment