Question: You ll need to write 3 methods, all of which must use recursion: 1 ) Write recursive _ multiply. It should take in 2 integers
Youll need to write methods, all of which must use recursion: Write recursivemultiply. It should take in integers and return an integer. Another way to say multiply is or or or You know that any number multiplied by is Write recursivediv. It should take in integers and return an integer. Unlike regular division, div just returns the integer portion of division. It answers the question how many times does the second number go into the first number So div because goes in times, the leftover is irrelevant to div. If you are asked to divide anything by you should return as thats an error. If you are asked to divide anything by itself, you should return ie div If you are asked to divide a small number by a bigger one, the answer is ie div For all other numbers, youll keep subtracting the second number from the first number, until the first number is less than the second. Youll count how many times this happens, and return that count. Remember you must use recursion in all of these methods.
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
