Advertisement
osman1997

Untitled

Aug 27th, 2020
321
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.13 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TestApps
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int hrizantema = int.Parse(Console.ReadLine());
  10. int roses = int.Parse(Console.ReadLine());
  11. int tulips = int.Parse(Console.ReadLine());
  12.  
  13. string season = Console.ReadLine();
  14. string isWeekDay = Console.ReadLine();
  15. int totalFlowers = hrizantema + roses + tulips;
  16.  
  17. double totalHrizantema = 0;
  18. double totalRoses = 0;
  19. double totalTulips = 0;
  20. double totalSum = 0;
  21.  
  22.  
  23. if ((season == "Spring") || (season == "Summer"))
  24. {
  25. totalHrizantema += (hrizantema * 2.00);
  26. totalRoses += (roses * 4.10);
  27. totalTulips += (tulips * 2.50);
  28. totalSum = (totalHrizantema + totalRoses + totalTulips);
  29.  
  30. if (isWeekDay == "Y")
  31. {
  32. totalSum *= 1.15;
  33. }
  34. if (season == "Spring" && tulips > 7)
  35. {
  36. totalSum *= 0.95;
  37. }
  38. if (totalFlowers > 20)
  39. {
  40. totalSum *= 0.80;
  41. }
  42. totalSum += 2;
  43.  
  44. }
  45. else if ((season == "Autumn") || (season == "Winter"))
  46. {
  47. totalHrizantema += (hrizantema * 3.75);
  48. totalTulips += (tulips * 4.5);
  49. totalRoses += (roses * 4.15);
  50. totalSum = (totalHrizantema + totalTulips + totalRoses);
  51.  
  52. if (isWeekDay == "Y")
  53. {
  54. totalSum *= 1.15;
  55. }
  56. if (season == "Winter" && roses >= 10)
  57. {
  58. totalSum *= 0.90;
  59. }
  60. if (totalFlowers > 20)
  61. {
  62. totalSum *= 0.80;
  63. }
  64. totalSum += 2;
  65. }
  66.  
  67. Console.WriteLine($"{totalSum:f2}");
  68.  
  69. }
  70. }
  71. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement