Exam 13: Recursion
Exam 1: Introduction76 Questions
Exam 2: Using Objects82 Questions
Exam 3: Implementing Classes108 Questions
Exam 4: Fundamental Data Types124 Questions
Exam 5: Decisions119 Questions
Exam 6: Loops107 Questions
Exam 7: Arrays and Array Lists117 Questions
Exam 8: Designing Classes88 Questions
Exam 9: Inheritance99 Questions
Exam 10: Interfaces100 Questions
Exam 11: Input/Output and Exception Handling108 Questions
Exam 12: Object-Oriented Design104 Questions
Exam 13: Recursion99 Questions
Exam 14: Sorting and Searching100 Questions
Exam 15: The Java Collections Framework102 Questions
Exam 16: Basic Data Structures102 Questions
Exam 17: Tree Structures102 Questions
Exam 18: Generic Classes75 Questions
Exam 19: Stream Processing85 Questions
Exam 20: Graphical User Interfaces75 Questions
Exam 21: Advanced Input/Output90 Questions
Exam 22: Multithreading81 Questions
Exam 23: Internet Networking74 Questions
Exam 24: Relational Databases75 Questions
Exam 25: XML74 Questions
Select questions type
Consider the method below, which prints the digits of an arbitrary positive integer in reverse order, one digit per line.The method should print the last digit first.Then, it should recursively print the integer obtained by removing the last digit.Select the statements that should be used to complete the method.

(Multiple Choice)
4.8/5
(49)
Consider the method powerOfTwo shown below:
What is the best interpretation of line #1?

(Multiple Choice)
4.9/5
(35)
Consider the getArea method from the book shown below.
What will happen when this code is executed?

(Multiple Choice)
4.8/5
(44)
Which of the following executions represent mutual recursion?
i.method E calls method T, which calls method F
II.method E calls method T, which calls method F, which calls method E
III.method F calls method F
(Multiple Choice)
4.9/5
(30)
Assume that recursive method search returns true if argument value is one of the elements in the section of the array limited by the firstIndex and lastIndex arguments.What statement can be used in main to determine if the value 7 is one of the elements in array values?

(Multiple Choice)
4.7/5
(31)
A termination condition in a loop is analogous to _____________ in a recursive method.
(Multiple Choice)
4.8/5
(32)
Complete the code for the calcPower recursive method shown below, which is intended to raise the base number passed into the method to the exponent power passed into the method:

(Multiple Choice)
4.9/5
(37)
If recursion does not have a special terminating case, what error will occur?
(Multiple Choice)
4.7/5
(38)
Recursion does NOT take place if any of the following happen:
i.method A calls method B, which calls method C, which calls method B
II.method A calls method B, which calls method A
III.method A calls method B, B returns, and A calls B again
(Multiple Choice)
4.9/5
(36)
Complete the following code snippet, which is intended to be a recursive method that reverses a String value:

(Multiple Choice)
4.8/5
(41)
Consider the square method shown below that takes a non-negative int argument:
What would a call to square(7) return?

(Multiple Choice)
4.9/5
(36)
Complete the following code snippet, which is intended to be a recursive method that will find the sum of all elements in an array of double values from the beginning of the array to index:

(Multiple Choice)
4.8/5
(38)
Given the following code snippet:
What value will be returned when this code is executed with a call to newCalc(15)?

(Multiple Choice)
4.9/5
(38)
Consider the recursive method myPrint shown in this code snippet:
What does this method do?

(Multiple Choice)
4.9/5
(38)
Insert the missing code in the following code fragment.This fragment is intended to recursively compute xn, where x and n are both non-negative integers:

(Multiple Choice)
4.8/5
(46)
Which of the following is NOT true about debugging a recursive method by setting a breakpoint on the line containing a return statement?
(Multiple Choice)
4.8/5
(33)
Complete the code for the myFactorial recursive method shown below, which is intended to compute the factorial of the value passed to the method:

(Multiple Choice)
4.9/5
(36)
Complete the code for the myFactorial recursive method shown below, which is intended to compute the factorial of the value passed to the method:

(Multiple Choice)
4.8/5
(39)
Consider the permutations method from the textbook, which is intended to return all permutations of the word passed in as a parameter.Which line contains the recursive call in the permutations method?

(Multiple Choice)
4.8/5
(37)
Complete the code for the recursive method printSum shown in this code snippet, which is intended to return the sum of digits from 1 to n:

(Multiple Choice)
4.9/5
(29)
Showing 61 - 80 of 99
Filters
- Essay(0)
- Multiple Choice(0)
- Short Answer(0)
- True False(0)
- Matching(0)