Computer Education Introduction to Computer Science Using Java™ Computer Education Introduction to Computer Science Using Java™   Glencoe Online
Computer Education Home Product Information Site Map Search Contact Us

Students

Self-Assessment Exercises

Chapter 17: Recursion
      
  1.Recursion is ________.  
  a.   another name for iteration  
  b.   when a method calls itself directly  
  c.   when a method calls itself indirectly  
  d.   Both b and c  
      
  2.Which of the following is true of tail recursion?  
  a.   The method does some work, and then calls itself.  
  b.   When the terminating condition is met, you pop up through all the layers of recursion, one after the other, all the way back up to the top.  
  c.   Programs that use tail recursion can often be rewritten using a simple iterative algorithm.  
  d.   All of the above  
      
  3.Which of the following is NOT true of the Towers of Hanoi program?  
  a.   It is based on a legend.  
  b.   The easiest way to solve it is to simplify it.  
  c.   The Java program to solve it is long and complicated.  
  d.   The problem is recursive in nature.  
      
  4.Which of the following is NOT true of the graphical Towers of Hanoi program presented in the book?  
  a.   The original non-object-oriented Java solution is easily expanded into a graphical solution.  
  b.   The object-oriented nature of Java helps to simplify the process of creating the graphical version.  
  c.   The objects are given the ability to draw themselves through inheritance.  
  d.   It includes a timer to animate the moving process.  
      
  5.In the graphical Towers of Hanoi program presented in the book, a ________ object is used to make the rings look realistic.  
  a.   GradientPaint  
  b.   Graphics  
  c.   Graphics2D  
  d.   Paint  

 

McGraw-Hill Glencoe   The McGraw-Hill Companies
Self-Assessment Exercises
Java Compilers
Source Code
Java Resources
PowerPoint® Presentations
Home