Spring 2006 - Homework 7
15 points
Out: April 18, 2006
Due: April 25, 2006
1. (5 points) Write the analysis and design for a recursive function NumDigits that returns the number of digits in a non-negative integer. E.g. NumDigits(1234) returns 4.
2. (5 points) Write the C++ function definition for the
recursive NumDigits function designed above.
3. (5 points) Write a C++ function definition for an iterative
(i.e., non-recursive) version of NumDigits.