Question: Write the base case(s) and the recursive call in English first, then write your java code. Write a recursive method to compute the following series:

Write the base case(s) and the recursive call in English first, then write your java code.

Write a recursive method to compute the following series: f(i) = 1/2 + 1/4 + 1/6 + .....+ 1/2i

Write a test program that displays f(i) for i = 1,2,3,4 and 5.

Sample run

i = 1 f(i) = 0.50

i = 2 f(i) = 0.75

i = 3 f(i) = 0.92

i = 4 f(i) = 1.04

i = 5 f(i) = 1.14

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!