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 3 methods, all of which must use recursion: 1) Write recursive_multiply. It should take in 2 integers and return an integer. Another way to say multiply 5*4, is 5+(5*3), or 5+5+(5*2), or 5+5+5+(5*1), or 5+5+5+5+(5*0). You know that any number multiplied by 0 is 0.2) Write recursive_div. It should take in 2 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,7 div 3=2, because 3 goes in 2 times, the leftover is irrelevant to div. If you are asked to divide anything by 0, you should return -1, as thats an error. If you are asked to divide anything by itself, you should return 1. i.e.7 div 7=1 If you are asked to divide a small number by a bigger one, the answer is 0. i.e.2 div 7=0 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 3 of these methods.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!