Question: Problem 1 : Create a Java class RecursiveMethods.java and create the following methods inside: ALL THE METHODS NEED TO BE COMPLETED RECURSIVLY. NO LOOPS ALLOWED.
Problem :
Create a Java class RecursiveMethods.java and create the following methods inside:
ALL THE METHODS NEED TO BE COMPLETED RECURSIVLY. NO LOOPS ALLOWED.
oddEvenMatchRec: the method takes an integer array as a parameter and returns a boolean. The method returns true if every odd index contains an odd integer AND every even index contains an even integer is even Otherwise it returns false.
sumNRec: The method takes an integer array A and returns the sum of all integers in the parameter array.
nDownToOne: Takes an integer and prints out the numbirs from down to each number on its own line.
inputAndPrintReverse: Inputs integers from the user until the user enters then prints the integers in reverse order. For this method, you may NOT use an array or any type of array structure, in other words, you may not use any structure to store the user input.
After completing the methods, use the main method to test them. You can hard code the tests.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
