Advertisement
Guest User

Untitled

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