Advertisement
Guest User

Untitled

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