Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone hlep me figure out this debugging exercise? The median for firstarray should be 5.5, secondarray 456, third array 28.5. DebugSeven4.cs + > Terminal
Can someone hlep me figure out this debugging exercise? The median for firstarray should be 5.5, secondarray 456, third array 28.5. DebugSeven4.cs + > Terminal + 7 using static system.Console; glass DebugSevend The median value of the first arra y is 6 ay is 456 The nedian value of the second arr The median value of the third arra static void Main() y is 45 - 15 16 1 int[] firstArray = {10, 9, 2, 3, 5, 6,}; int[] secondArray {112, 456, 782); int[] thirdArray = {9, 12, 45, 82, 84, 67, 2, 6); WriteLine("The median value of the first array is {0}", FindMedian(firstArray)); WriteLine("The median value of the second array is {0}", FindMedian(secondArray)); WriteLine("The median value of the third array is {0}", FindMedian(thirdArray)); 3 private static double FindMedian(int[] array) 18 19 29 21 22 23 24 25 26 27 int median; I median array.Length/2; Array. Sort(array): if(array.Length / 2 == 0) median (int)(array[median - 1] + array[median]) / 2; else median = array [media]; return median
Can someone hlep me figure out this debugging exercise? The median for firstarray should be 5.5, secondarray 456, third array 28.5.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started