Advertisement
Again_89

За мими китки

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