Question: IN JAVA ----- NEED HELP ! The th Harmonic number is the sum of the reciprocals of the first natural numbers: ( ) = 1
IN JAVA ----- NEED HELP !
The th Harmonic number is the sum of the reciprocals of the first natural numbers: ( ) = 1 + 12 + 13 + 14 + + 1 Write a recursive method and accompanying main method to compute and display the th Harmonic number. Your main method should prompt the user for the number , and should pass this user-entered number to your recursive method. The main method should then display the number returned by your recursive method. Here is an example test run of the main method I wrote as a solution to this exercise: Enter a number and I will determine its harmonic sum: 5 The harmonic sum of 5 is 2.283333333333333 Its worth noting that the Harmonic sum of 5 is computed by the summation: (5) = 1 + 12 + 13 + 14 + 15 = 2.283333333333333 The name of the method which computes and returns this harmonic sum should be named harmonic. Sum and this method should compute the sum recursively.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
