Question: Please help me to solve this code /** Programming Quiz - Processing Data with Arrays and Methods @author @version */ public class PQ08 { /**
Please help me to solve this code
/** Programming Quiz - Processing Data with Arrays and Methods @author @version */ public class PQ08 { /** * Write the method reverseEnds() * * Your method will take an array of int of length 1 or more. * You should "reverse" the first and last element so {1, 2, 3} * becomes {3, 2, 1}. Return the modified parameter. * * Some examples: * reverseEnds({1, 2, 3}) -> {3, 2, 1} * reverseEnds({5, 11, 9, 10}) -> {10, 11, 9, 5} * reverseEnds({7, 0, 0}) -> {0, 0, 7} * * @param nums an array of int of any size. * @return the modified parameter nums */ // WRITE THE METHOD reverseEnds() HERE /** * Write the method maxTriple() * * Start with one int array (of odd length). * Your method should look at the first, last, * and middle values in the array and return * the largest. The array length will be a * least 1. * * Here are some examples: * maxTriple({1, 2, 3}) returns 3 * maxTriple({1, 5, 3}) returns 5 * maxTriple({5, 2, 3}) returns 5 * * @param nums an array of int (at least 1 long) * @return the largest of the first, last or middle. */ // WRITE THE METHOD maxTriple() HERE }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
