Advertisement
AnastasiyaG

Untitled

Sep 25th, 2019
207
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.73 KB | None | 0 0
  1. using System;
  2.  
  3. public class Program
  4. {
  5. public static void Main()
  6. {
  7. string fruit = Console.ReadLine();
  8. string day = Console.ReadLine();
  9. double count = double.Parse(Console.ReadLine());
  10.  
  11. double price = 0;
  12. double total = 0;
  13.  
  14. if ( day == "Monday" || day == " Tuesday" || day == "Wednesday" || day == "Thursday" || day == "Friday")
  15. {
  16. switch (fruit)
  17. {
  18. case "banana":
  19. price = 2.50;
  20. total = price*count;
  21. break;
  22.  
  23. case "apple":
  24. price = 1.20;
  25. total = price*count;
  26. break;
  27. case "orange":
  28. price = 0.85;
  29. total = price*count;
  30. break;
  31. case "grapefruit":
  32. price = 1.45;
  33. total = price*count;
  34. break;
  35. case "kiwi":
  36. price = 2.70;
  37. total = price*count;
  38. break;
  39.  
  40. case "pineapple":
  41. price = 5.50;
  42. total = price*count;
  43. break;
  44.  
  45. case "grapes":
  46. price = 3.85;
  47. total = price*count;
  48. break;
  49. Console.WriteLine("{0:f2}", total);
  50. }
  51.  
  52. }
  53. if (day =="Saturday" || day== "Sunday")
  54. {
  55. switch (fruit)
  56. {
  57. case "banana":
  58. price = 2.70;
  59. total = price*count;
  60. break;
  61.  
  62. case "apple":
  63. price = 1.25;
  64. total = price*count;
  65. break;
  66. case "orange":
  67. price = 0.90;
  68. total = price*count;
  69. break;
  70. case "grapefruit":
  71. price = 1.60;
  72. total = price*count;
  73. break;
  74. case "kiwi":
  75. price = 3.0;
  76. total = price*count;
  77. break;
  78.  
  79. case "pineapple":
  80. price = 5.60;
  81. total = price*count;
  82. break;
  83.  
  84. case "grapes":
  85. price = 4.20;
  86. total = price*count;
  87. break;
  88. Console.WriteLine("{0:f2}", total);
  89. }
  90.  
  91.  
  92.  
  93. }
  94.  
  95. }
  96. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement