Answered step by step
Verified Expert Solution
Link Copied!

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. image text in transcribed
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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Put Your Data To Work 52 Tips And Techniques For Effectively Managing Your Database

Authors: Wes Trochlil

1st Edition

0880343079, 978-0880343077

More Books

Students also viewed these Databases questions