Advertisement
Guest User

Untitled

a guest
Feb 24th, 2020
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.40 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Shop2
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. // Магазин за плодове през работните дни работи на следните цени:
  10. // плод banana apple orange grapefruit kiwi pineapple grapes
  11. // цена 2.50 1.20 0.85 1.45 2.70 5.50 3.85
  12. //Събота и неделя магазинът работи на по - високи цени:
  13. // плод banana apple orange grapefruit kiwi pineapple grapes
  14. //цена 2.70 1.25 0.90 1.60 3.00 5.60 4.20
  15. string fruits = Console.ReadLine();
  16. string day = Console.ReadLine();
  17. double kolichestvo = double.Parse(Console.ReadLine());
  18.  
  19. if (day == "Monday" || day == "Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday")
  20. {
  21. if (fruits == "banana")
  22. {
  23. Console.WriteLine($"{kolichestvo * 2.50:F2}");
  24. }
  25. else if (fruits == "apple")
  26. {
  27. Console.WriteLine($"{kolichestvo * 1.20:F2}");
  28. }
  29. else if (fruits == "orange")
  30. {
  31. Console.WriteLine($"{kolichestvo * 0.85:F2}");
  32. }
  33. else if (fruits == "grapefruit")
  34. {
  35. Console.WriteLine($"{kolichestvo * 1.45:F2}");
  36. }
  37. else if (fruits == "kiwi")
  38. {
  39. Console.WriteLine($"{kolichestvo * 2.70:F2}");
  40. }
  41. else if (fruits == "pineapple")
  42. {
  43. Console.WriteLine($"{kolichestvo * 5.50:F2}");
  44. }
  45. else if (fruits == "grapes")
  46. {
  47. Console.WriteLine($"{kolichestvo * 3.85:F2}");
  48. }
  49. else {
  50. Console.WriteLine("Error");
  51. }
  52. }
  53. else if (day == "Saturday" || day == "Sunday")
  54. {
  55. if (fruits == "banana")
  56. {
  57. Console.WriteLine($"{kolichestvo * 2.70:F2}");
  58. }
  59. else if (fruits == "apple")
  60. {
  61. Console.WriteLine($"{kolichestvo * 1.25:F2}");
  62. }
  63. else if (fruits == "orange")
  64. {
  65. Console.WriteLine($"{kolichestvo * 0.90:F2}");
  66. }
  67. else if (fruits == "grapefruit")
  68. {
  69. Console.WriteLine($"{kolichestvo * 1.60:F2}");
  70. }
  71. else if (fruits == "kiwi")
  72. {
  73. Console.WriteLine($"{kolichestvo * 3.00:F2}");
  74. }
  75. else if (fruits == "pineapple")
  76. {
  77. Console.WriteLine($"{kolichestvo * 5.60:F2}");
  78. }
  79. else if (fruits == "grapes")
  80. {
  81. Console.WriteLine($"{kolichestvo * 4.20:F2}");
  82. }else {
  83. Console.WriteLine("Error");
  84. }
  85. }
  86. else
  87. {
  88. Console.WriteLine("Error");
  89. }
  90. }
  91. }
  92. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement