Advertisement
KrasenPenev

new house

Jan 28th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 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 New_House
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string flowersType = Console.ReadLine();
  14. int flowersNum = int.Parse(Console.ReadLine());
  15. double budget = double.Parse(Console.ReadLine());
  16. double sumForFlowers = 0;
  17.  
  18.  
  19. if (flowersType == "Roses")
  20. {
  21. sumForFlowers = flowersNum * 5;
  22. if (flowersNum >= 80)
  23. {
  24. sumForFlowers = sumForFlowers - (sumForFlowers * 0.1);
  25. }
  26.  
  27. }
  28. if (flowersType== "Tulips")
  29. {
  30. sumForFlowers = sumForFlowers * 2.80;
  31. if (flowersNum>=80)
  32. {
  33. sumForFlowers = sumForFlowers - sumForFlowers * 0.15;
  34. }
  35. else
  36. {
  37. sumForFlowers = sumForFlowers*1;
  38. }
  39.  
  40. }
  41. if (budget > sumForFlowers)
  42. {
  43. Console.WriteLine($"Hey, you have a great garden with {flowersNum} {flowersType} and {budget - sumForFlowers:F2} leva left.");
  44. }
  45. else if (budget < sumForFlowers)
  46. {
  47. Console.WriteLine($"Not enough money, you need {sumForFlowers - budget:F2} leva more.");
  48. }
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement