Question: Write a recursive static method called sumMult that takes two integers n and m (where n > m). The method should return a long number

 Write a recursive static method called sumMult that takes two integers

Write a recursive static method called sumMult that takes two integers n and m (where n > m). The method should return a long number obtained by the following formula: n* m + (n 1) * (m + 1) + (n 2) * (m + 2) + ... + x* y where x is the lowest value that is greater than y For example: If n = 12 and m = 6, the method calculates and returns the value of: 12*6 + 11 * 7 + 10*8 = 229 If n = 7 and m = 4, the method calculates and returns the value of: 7*4 + 6 * 5 = 58

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 Databases Questions!