Question: import java.util.*; public class Form_B { W Add createWedge method here W add indecreasing method here V/ add isMedian method here w add removeBetween method



import java.util.*; public class Form_B { W Add createWedge method here W add indecreasing method here V/ add isMedian method here w add removeBetween method here Complete the following methods in Form_B class so that the code in the Driver_B class will run. You should make NO CHANGES to the driver class. Simply complete the methods in Form_B. 1. Complete the following method that returns a built-in array of integers. If the parameter, n, is not 1 or larger, return null. // returns an array filled with values // 1, 2, 3, n-1, n, n-1, 1-2, 2, 1. public static int[] createWedge ( int n 1 Example: createWedge ( 7 ) { 1 2 3 4 5 6 7 6 5 4 3 2 1 createWedge ( 3 ) 1 1 2 3 21 ) createWedge ( 1 ) 11 ) createWedge ( -5 ) null true false 2. Write a method is Decreasing that takes a built-in array of doubles and returns true or false indicating whether the array elements a[0], a[1]... are in decreasing order. Example: isDecreasing ( ( 1.60, 1.60, 1.00, 0.90, 0.20, 0.10) ) is Decreasing ( 1 1.60, 1.60, 1.00, 2.00, 0.907 ) Strategy: compare consecutive elements in the array and return false if you ever encounter a consecutive pair that is out of numerically increasing order. If you never find an out of sequence pair, return true. 3. Write a method is Median that determines whether a given double value, m, is a median for the values stored in an ArrayList of Doubles. The method will return true if the number of elements in the array that are strictly larger than the given number is the same as the number of elements that are strictly less than m Example: isMedian ( [1.0, 2.0, 3.0, 4.0, 5.0), 3.0) true this call returned true since there are 2 values larger than 3.0 and 2 values less than 3.0 3. Write a method isMedian that determines whether a given double value, m, is a median for the values stored in an ArrayList of Doubles. The method will return true if the number of elements in the array that are strictly larger than the given number is the same as the number of elements that are strictly less than m Example: isMedian ( 11.0, 2.0, 3.0, 4.0, 5.0), 3.0) true this call returned true since there are 2 values larger than 3.0 and 2 values less than 3.0 isMedian (1.0, 2.0, 3.0, 4.0, 5.0), 3.5) false this call returned false since there are 2 values larger than 3.5 but 3 values less than 3.5 isMedian ( 13.0, 3.0, 3.0, 3.0, 3.0], 3.0) > true this call returned true since there are 0 values larger than 3.0 and 0 values less than 3.0 4. Write a void method removeBetween that takes an ArrayList of Doubles and two double parameters m and n, swaps them if necessary to make m
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
