Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.19 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 FlowerShop
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. //vhodni danni
  14. var hrizantemi = int.Parse(Console.ReadLine());
  15. var rozi = int.Parse(Console.ReadLine());
  16. var laleta = int.Parse(Console.ReadLine());
  17. string season = Console.ReadLine().ToLower();
  18. var isHoliday = Console.ReadLine().ToLower();
  19. //promenlivi
  20. double priceHrizSeason=0.00;
  21. double priceRoziSeason = 0.00;
  22. double priceLaleSeason = 0.00;
  23. double holidayPriceHriz = priceHrizSeason + priceHrizSeason * 0.15;
  24. double holidayPriceRozi = priceRoziSeason + priceRoziSeason * 0.15;
  25. double holidayPriceLale = priceLaleSeason + priceLaleSeason * 0.15;
  26. int buntFlower = hrizantemi + rozi + laleta;
  27. double buntFlowerPrice;
  28. double PriceWithDiscoun;
  29. double HolidayPrice;
  30. //LYATO PROLET
  31. if (season=="summer" || season == "spring")
  32. {
  33. priceHrizSeason = 2.00;
  34. priceRoziSeason = 4.10;
  35. priceLaleSeason = 2.50;
  36. buntFlowerPrice = hrizantemi * priceHrizSeason + laleta * priceLaleSeason + rozi * priceRoziSeason;
  37. HolidayPrice = buntFlowerPrice + buntFlowerPrice*0.15;
  38. if (isHoliday == "y")
  39. {
  40. if (laleta > 7 && buntFlower < 20)
  41. {
  42. PriceWithDiscoun = HolidayPrice- HolidayPrice * 0.05 + 2;
  43. Console.WriteLine($"{PriceWithDiscoun:f2}");
  44. }
  45. else if (buntFlower > 20)
  46. {
  47. PriceWithDiscoun = HolidayPrice - HolidayPrice * 0.2;
  48. Console.WriteLine($"{PriceWithDiscoun:f2}");
  49. }
  50. else
  51. {
  52. Console.WriteLine(HolidayPrice);
  53. }
  54.  
  55. }
  56.  
  57. else if (isHoliday == "n")
  58. {
  59. Console.WriteLine(buntFlowerPrice);
  60. }
  61.  
  62.  
  63.  
  64. else
  65. {
  66. buntFlowerPrice = (hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi) + 2;
  67. Console.WriteLine($"{buntFlowerPrice:f2}");
  68. }
  69.  
  70. }
  71. //ZIMA _ESEN
  72. if (season == "autumn" || season == "winter")
  73. {
  74. priceHrizSeason = 3.75;
  75. priceRoziSeason = 4.50;
  76. priceLaleSeason = 4.10;
  77. holidayPriceHriz = priceHrizSeason + priceHrizSeason * 0.15;
  78. holidayPriceRozi = priceRoziSeason + priceRoziSeason * 0.15;
  79. holidayPriceLale = priceLaleSeason + priceLaleSeason * 0.15;
  80.  
  81. if (isHoliday == "y")
  82. {
  83. buntFlowerPrice = hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi;
  84. PriceWithDiscoun = buntFlowerPrice + 2;
  85.  
  86. if (rozi > 10 && buntFlower < 20)
  87. {
  88. buntFlowerPrice = hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi;
  89. PriceWithDiscoun = buntFlowerPrice - buntFlowerPrice * 0.10 + 2;
  90. Console.WriteLine($"{PriceWithDiscoun:f2}");
  91. }
  92. else if (buntFlower > 20)
  93. {
  94. buntFlowerPrice = (hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi) + 2;
  95. PriceWithDiscoun = buntFlowerPrice - buntFlowerPrice * 0.2;
  96. Console.WriteLine($"{PriceWithDiscoun:f2}");
  97. }
  98. else
  99. {
  100. buntFlowerPrice = (hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi) + 2;
  101. Console.WriteLine($"{buntFlowerPrice:f2}");
  102. }
  103.  
  104. }
  105.  
  106. else if (isHoliday == "n")
  107. {
  108. if (rozi > 10 && buntFlower < 20)
  109. {
  110. buntFlowerPrice = hrizantemi * holidayPriceHriz + laleta * holidayPriceLale + rozi * holidayPriceRozi;
  111. PriceWithDiscoun = buntFlowerPrice - buntFlowerPrice * 0.10 + 2;
  112. Console.WriteLine($"{PriceWithDiscoun:f2}");
  113. }
  114. buntFlowerPrice = (hrizantemi * priceHrizSeason + laleta * priceLaleSeason + rozi * priceRoziSeason) + 2;
  115. }
  116.  
  117.  
  118.  
  119.  
  120. }
  121.  
  122. }
  123.  
  124. //switch (season)
  125. //{
  126. // case "Summer" || "Spring" :
  127.  
  128.  
  129. // break;
  130. //}
  131.  
  132. }
  133. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement