Question: This is a Lab Challenge. You must watch the video (located in the Lab Participation item in the current module in Canvas), and complete and




This is a Lab Challenge. You must watch the video (located in the Lab Participation item in the current module in Canvas), and complete and submit the code for this lab. the video includes questions that you must answer in order to receive full credit for this Lab. All the code you will need is provided and explained in the video. Required Skills inventory - Write a method that take an argument and returns a value - Write a method that takes an array as an argument - Use an index value to access an array element. Do not use any language features that have not been covered to this point in the course materials. Problem Description and Given Info Write (define) a public static method named get First, that takes an Array of int as an argument and retums (as an int) the value of the first element of the array. For example, given the following Array declaration and instantiation int[1=yArray=(1,22,333,400,5005,9)1 getFirst (myArray) will return 1 You may wish to write some additional code to test your method. Need Help? This is a Lab Challenge. You must watch the video (located in the Lab Participation item in the current module in Canvas), and complete and submit the code for this lab the video includes questions that you must answer in order to receive full credit for this Lab. All the code you will need is provided and explained in the video. Required Skills Inventory - Wite a method that take an argument and returns a value - Write a method that takes an array as an argument - Use an index value to access an array element - Use the length property of an array to determine the size of the array Do not use any language features that have not been covered to this point in the course materials. Problem Description and Given Info Write (define) a public stat ic method named get Last, that takes an Array of int as an argument and returns the int value of the last element of the array. For example, given the following Array declaration and instantiation: int0]myrray=(1,22,333,400,5005,9)i getLast (myArray) will return 9 You may wish to write some additional code to test your method: Need Helo? This is a Lab Challenge. You must watch the video (located in the Lab Participation item in the current module in Carvvas), and complete and submit the code for this lab. the video includes questions that you must answer in order to receive full credit for this Lab. All the code you will need is provided and explained in the video. Required Skills Inventory - Write a method that takes arguments and returns a value - Write a method that takes an array as an argument - Use a loop to iterate over the elements of an array - Use an index value to access an array element - Perform a linear search through an array - Use an if statement to get the computer to make a decision - Use the length property of an array to determine the size of the array Do not use any language features that have not been covered to this point in the course materials. Problem Description and Given Info Write (define) a public stat ic method named contains, that takes an Array of int and an int as an arguments. This method should return the boolean value true if the second argument value is in the argument array; otherwise the method should retum the boo lean value fatse For example, given the following Array declaration and instantiation: int[]myArxay{22,5005,400,333,1,91t contains (myArray, 123) will return false contains (myArray, 400) will return true This is a Lab Challenge. You must watch the video (located in the Lab Participation item in the current module in Canvas), and complete and submit the code for this lab. the video includes questions that you must answer in order to receive full credit for this Lab. All the code you will need is provided and explained in the video. Required Skills Inventory - Write a method that takes an argument and returns a value - Write a method that takes an array as an argument - Write a method that returns an array - Use a loop to iterate over the elements of an array - Use an index value to access an array element - Copy values from one array to another - Declare and instantiate an array Do not use any language features that have not been covered to this point in the course materials. Problem Description and Given Info Write (define) a public static method named getAl LutFirst, that takes an Array of int as an argument and returns a new Array of int with all of the values in the argument array except the first value. For example, given the following Array declaration and instantiation: Int 11 myArray {1,22,333,400,5005,9}1 getAlLButFirst (myArray) will return an Array of int with these values {22,333,400,5005,9} You may wish to write some additional code to test your method: This is a Lab Challenge. You must watch the video (located in the Lab Participation item in the current module in Canvas), and complete and submit the code for this lab. the video includes questions that you must answer in order to receive full credit for this Lab. All the code you will need is provided and explained in the video. Required Skills Inventory - Write a method that takes arguments and returns a value - Write a method that takes an array as an argument - Write a method that returns an array - Use a loop to iterate over the elements of an array - Use an index value to access an array element - Use an if statement to got the computer to make a decision - Copy values from one array to another - Declare and instantiate an array Do not use any language features that have not been covered to this point in the course materials. Problem Description and Given Info Write (define) a public static method named getAltGreater Than, that takes an array of int, and an int as arguments and returns a an int array with all of the values in the argument atray that are greater than the second argument value. For example, given the following Array declaration and instantiation: int [1 myArray =(1,22,333,400,5005,9)= getAltGreaterThan (myArray, 200) will return an Array of int with these values {333,400,5005} Note that the values in the returned array must be in the same order as they are in the argument array
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
