Design a recursive progam function that accepts two argumentsinto the parameters
ID: 3615246 • Letter: D
Question
Design a recursive progam function that accepts two argumentsinto the parameters x and y. The function should return thevalue of x times y. Remember, multiplication can be performedas repeated addition as follows: 7x4= 4+4+4+4+4+4+4 (To keep the function simple, assume that x and y will alwayshold positive zero integers) I just need this in pseudocode or in a raptor flowchart, whichever is easier. Thanks Design a recursive progam function that accepts two argumentsinto the parameters x and y. The function should return thevalue of x times y. Remember, multiplication can be performedas repeated addition as follows: 7x4= 4+4+4+4+4+4+4 (To keep the function simple, assume that x and y will alwayshold positive zero integers) I just need this in pseudocode or in a raptor flowchart, whichever is easier. ThanksExplanation / Answer
please rate - thanks I don't think raptor does recursion, so here's my version ofpseudocode main program get the 1st number (n) get the 2nd number (m) answer= mult(n,m) output answer function mult receive parameters m, n n=1? yes: return m no: return m+ mult(m,n-1)
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.