CIS 110 Spring 2013 - Introduction to Computer Programming

upenn.edu | directories | van pelt library
seas.upenn.edu | CETS | engineering library
computer graphics & game dev (SIGGRAPH @ Penn) | dining philosophers (DP) | science & tech wing (STWING) | women in cs (WICS)
CETS Answers

Recitation 3 Exercise

Goals

The goal of these recitation exercises is to help you review the concept of recursion and to come prepared with Exam review questions.

Exercises

  • Write a recursive function power that takes two ints as arguments representing a number and exponent, and returns an int that is number exponent (as was done for rec02). For example, power(3, 2) should return 9. Do NOT use Math.pow() and be sure to use recursion.
  • Read through and attempt the Practice Exam located on the Exams page. Specifically, try to focus on #5-#8. Come prepared with any questions you have regarding specific questions or general concepts.