Question: Re-write the following as a recursive method. **** * * get Sum Return the sum of all positive integers 1 thru n For example getSum

Re-write the following as a recursive method.

Re-write the following as a recursive method. **** * * get Sum

**** * * get Sum Return the sum of all positive integers 1 thru n For example getSum (4) = 1 + 2 +3 + 4 = 10 * @parameter n indicating number of positive integers @return sum * *********** **** */ private int getSum(int n) int result = 0; for (int i =1; i

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!