Guest User

Untitled

a guest
Sep 28th, 2019
438
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.77 KB | None | 0 0
  1. using System;
  2.  
  3. namespace fruitShop
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. string product = Console.ReadLine();
  10. string dayOfTheWeek = Console.ReadLine();
  11. double quantity = double.Parse(Console.ReadLine());
  12.  
  13.  
  14.  
  15. if (dayOfTheWeek == "Monday" || dayOfTheWeek == "Tuesday" || dayOfTheWeek == "Wednesday" || dayOfTheWeek == "Thursday" || dayOfTheWeek == "Friday")
  16. {
  17.  
  18. if (product == "banana")
  19. {
  20.  
  21. Console.WriteLine($"{quantity * 2.50:f2}");
  22.  
  23. }
  24.  
  25. if (product == "apple")
  26. {
  27.  
  28. Console.WriteLine($"{quantity * 1.20:f2}");
  29.  
  30. }
  31.  
  32. if (product == "orange")
  33. {
  34.  
  35. Console.WriteLine($"{quantity * 0.85:f2}");
  36.  
  37. }
  38.  
  39. if (product == "grapefruit")
  40. {
  41.  
  42. Console.WriteLine($"{quantity * 1.45:f2}");
  43.  
  44. }
  45.  
  46. if (product == "kiwi")
  47. {
  48.  
  49. Console.WriteLine($"{quantity * 2.70:f2}");
  50.  
  51. }
  52. if (product == "pineaple")
  53. {
  54.  
  55. Console.WriteLine($"{quantity * 5.50:f2}");
  56.  
  57. }
  58. if (product == "grapes")
  59. {
  60.  
  61. Console.WriteLine($"{quantity * 3.85:f2}");
  62.  
  63. }
  64.  
  65.  
  66.  
  67. }
  68.  
  69. else if (dayOfTheWeek == "Saturday" || dayOfTheWeek == "Sunday")
  70. {
  71. if (product == "banana")
  72. {
  73.  
  74. Console.WriteLine($"{quantity * 2.70:f2}");
  75.  
  76. }
  77.  
  78. if (product == "apple")
  79. {
  80.  
  81. Console.WriteLine($"{quantity * 1.25:f2}");
  82.  
  83. }
  84.  
  85. if (product == "orange")
  86. {
  87.  
  88. Console.WriteLine($"{quantity * 0.90:f2}");
  89.  
  90. }
  91.  
  92. if (product == "grapefruit")
  93. {
  94.  
  95. Console.WriteLine($"{quantity * 1.60:f2}");
  96.  
  97. }
  98.  
  99. if (product == "kiwi")
  100. {
  101.  
  102. Console.WriteLine($"{quantity * 3.00:f2}");
  103.  
  104. }
  105. if (product == "pineaple")
  106. {
  107.  
  108. Console.WriteLine($"{quantity * 5.60:f2}");
  109.  
  110. }
  111. if (product == "grapes")
  112. {
  113.  
  114. Console.WriteLine($"{quantity * 4.20:f2}");
  115.  
  116. }
  117.  
  118.  
  119. }
  120. else
  121. {
  122. Console.WriteLine("error");
  123. }
  124.  
  125.  
  126.  
  127.  
  128. }
  129.  
  130. }
  131. }
Advertisement
Add Comment
Please, Sign In to add comment