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 1:
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(0 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 n and prints out the numbirs from n down to 1, each number on its own line.
inputAndPrintReverse: Inputs integers from the user until the user enters 0, 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.
Problem 1 : Create a Java class

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 Programming Questions!