Question: Question 5 (2 points) Write the method myMedian that takes in an Array of sorted integers stored in an argument named vals and returns the

 Question 5 (2 points) Write the method "myMedian" that takes in

an Array of sorted integers stored in an argument named "vals" and

Question 5 (2 points) Write the method "myMedian" that takes in an Array of sorted integers stored in an argument named "vals" and returns the median value. Remember if it is an odd number of values it takes he middle number and and even the average of the middle two. Example vals with 1,2,3,4,6 returns 3, with 1,2,3,4,5,6 returns 3.5 Question 6 (2 points) Write the method myStack that takes in a String and does not return anything but prints the following "word stack" from the argument str. If the word has an odd number of letters print "Enter a String that has an even number of letters" str = "Apples"; Output: A Ap App Appl Apple Apples === str = "Bees" 00 B Be Bee Bees str =: Trees -> "Only works for Strings with an Even Number of Letters

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!