Mucunata101

Untitled

Mar 31st, 2017
162
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.27 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 FruitShop
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. string fruits = Console.ReadLine();
  14. string dayOfWeek = Console.ReadLine().ToLower();
  15. double quantity = double.Parse(Console.ReadLine());
  16. double price = -1.0;
  17.  
  18. if (dayOfWeek == "monday" || dayOfWeek == "tuesday" || dayOfWeek == "wednesday" || dayOfWeek == "thursday" ||
  19. dayOfWeek == "friday") ;
  20. {
  21. if (fruits == "banana") price = 2.50;
  22. {
  23. if (price >= 0)
  24. {
  25. Console.WriteLine("{0:f2}", price * quantity);
  26. }
  27. }
  28. }
  29. if (fruits == "apple") price = 1.20;
  30. {
  31. if (price >= 0)
  32. {
  33. Console.WriteLine("{0:f2}", price * quantity);
  34. }
  35. }
  36. if (fruits == "orange") price = 0.85;
  37. {
  38. if (price >= 0)
  39. {
  40. Console.WriteLine("{0:f2}", price * quantity);
  41. }
  42. }
  43. if (fruits == "grapefruit") price = 1.45;
  44. {
  45. if (price >= 0)
  46. {
  47. Console.WriteLine("{0:f2}", price * quantity);
  48. }
  49. }
  50. if (fruits == "kiwi") price = 2.70;
  51. {
  52. if (price >= 0)
  53. {
  54. Console.WriteLine("{0:f2}", price * quantity);
  55. }
  56. }
  57. if (fruits == "pineapple") price = 5.50;
  58. {
  59. if (price >= 0)
  60. {
  61. Console.WriteLine("{0:f2}", price * quantity);
  62. }
  63. }
  64. if (fruits == "grapes") price = 3.85;
  65. {
  66. if (price >= 0)
  67. {
  68. Console.WriteLine("{0:f2}", price * quantity);
  69. }
  70. else
  71. {
  72. Console.WriteLine("error");
  73. }
  74. if (dayOfWeek == "saturday" || dayOfWeek == "sunday") ;
  75. {
  76. if (fruits == "banana") price = 2.70;
  77. {
  78. if (price >= 0)
  79. {
  80. Console.WriteLine("{0:f2}", price * quantity);
  81. }
  82.  
  83. }
  84. }
  85. if (fruits == "apple") price = 1.25;
  86. {
  87. if (price >= 0)
  88. {
  89. Console.WriteLine("{0:f2}", price * quantity);
  90. }
  91.  
  92. }
  93. if (fruits == "orange") price = 0.90;
  94. {
  95. if (price >= 0)
  96. {
  97. Console.WriteLine("{0:f2}", price * quantity);
  98. }
  99. }
  100. if (fruits == "grapefruit") price = 1.60;
  101. {
  102. if (price >= 0)
  103. {
  104. Console.WriteLine("{0:f2}", price * quantity);
  105. }
  106. }
  107. if (fruits == "kiwi") price = 3.00;
  108. {
  109. if (price >= 0)
  110. {
  111. Console.WriteLine("{0:f2}", price * quantity);
  112. }
  113. }
  114. if (fruits == "pineapple") price = 5.60;
  115. {
  116. if (price >= 0)
  117. {
  118. Console.WriteLine("{0:f2}", price * quantity);
  119. }
  120. }
  121. if (fruits == "grapes") price = 4.20;
  122. {
  123. if (price >= 0)
  124. {
  125. Console.WriteLine("{0:f2}", price * quantity);
  126. }
  127. else
  128. {
  129. Console.WriteLine("error");
  130. }
  131. }
  132.  
  133.  
  134. }
  135. }
  136. }
  137. }
Advertisement
Add Comment
Please, Sign In to add comment