Advertisement
ss3434

Untitled

Oct 10th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 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 s
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string flowers = Console.ReadLine();
  14. int numFlower=int.Parse(Console.ReadLine());
  15. int budget= int.Parse(Console.ReadLine());
  16. double sum = 0;
  17. if (flowers=="Roses")
  18. {
  19.  
  20. if (numFlower>80)
  21. {
  22. sum = numFlower * 5;
  23. sum -= sum * 0.10;
  24. }
  25. else
  26. {
  27. sum = numFlower * 5;
  28. }
  29.  
  30. }
  31. else if (flowers == "Dahlias")
  32. {
  33.  
  34. if (numFlower > 90)
  35. {
  36. sum = numFlower * 3.80;
  37. sum -= sum * 0.15;
  38. }
  39. else
  40. {
  41. sum = numFlower * 3.80;
  42. }
  43.  
  44. }
  45. else if (flowers == "Tulips")
  46. {
  47.  
  48. if (numFlower > 80)
  49. {
  50. sum = numFlower * 2.80;
  51. sum -= sum * 0.15;
  52. }
  53. else
  54. {
  55. sum = numFlower * 2.80;
  56. }
  57.  
  58. }
  59. else if (flowers == "Narcissus")
  60. {
  61.  
  62. if (numFlower < 120)
  63. {
  64. sum = numFlower * 3;
  65. sum += sum * 0.15;
  66. }
  67. else
  68. {
  69. sum = numFlower * 3;
  70. }
  71.  
  72. }
  73. else if (flowers == "Gladiolus")
  74. {
  75.  
  76. if (numFlower < 80)
  77. {
  78. sum = numFlower * 2.50;
  79. sum += sum * 0.20;
  80. }
  81. else
  82. {
  83. sum = numFlower * 2.50;
  84. }
  85. }
  86. if (budget>=sum)
  87. {
  88. var a = budget - sum;
  89. Console.WriteLine($"Hey, you have a great garden with {numFlower} {flowers} and {a:f2} leva left.");
  90. }
  91. else
  92. {
  93. var a = sum-budget;
  94. Console.WriteLine($"Not enough money, you need {a:f2} leva more.");
  95. }
  96. }
  97. }
  98. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement