Question: CSC 2 2 2 Module 4 Coding Assignment - Recursion Write a program that uses a recursive call to find the integer logk of a
CSC Module Coding Assignment Recursion
Write a program that uses a recursive call to find the integer logk of a number. Where logk returns the integer log of a number in a designated base. For example, the integer base of is and the integer base of is This is a relatively easy calculation. You simply repeatedly divide the number by the base using integer division until the quotient is less than the base and count the number of completed divisions.
Notice that the number is actually and in base the number would be
The key point here is that the highest power in these numbers in the integer log value.
Hint use the number and the base as arguments to your recursive call, then your base case is when number is less than base and returns and the general case returns plus the returned value of the recursive call.
Your program should behave as follows.
Please enter a number to find the integer log of
Please enter the base for the calculation
The base integer log of is
Would you like to enter another pair of numbers?
Please enter y for yes or n for no
b
Please enter y for yes or n for no
y
Please enter a number to find the integer log of
Please enter the base for the calculation
The base integer log of is
Would you like to enter another pair of numbers?
Please enter y for yes or n for no
n
Goodbye!
Mobile View
Read Aloud
Headings
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
