Come up with a recursive definition and use it to guide you to write a method definition for a double -valued method named harmonic that accepts an int parameters n and recursively calculates and returns the nth harmonic number.

Come up with a recursive definition and use it to guide you to write a method definition for a double -valued method named harmonic that accepts an int parameters n and recursively calculates and returns the nth harmonic number.

LANGUAGE: Java

CHALLENGE:

The nth harmonic number is defined non-recursively as: 1 +1/2 + 1/3 + 1/4 + … + 1/n.
Come up with a recursive definition and use it to guide you to write a method definition for a double -valued method named harmonic that accepts an int parameters n and recursively calculates and returns the nth harmonic number.

This content requires that you purchase additional access. The price is $2.99 or free for our Make Life Easier and 30 Days – Not Recurring members.

Purchase this Content ($2.99) Choose a Membership Level