# Finding Harmonic Sums Two Ways

Write a class named HarmonicSumFinder whose main method prompts the user for some positive integer $n$, and then calculates the sum of the first $n$ terms of the harmonic series shown below in two ways: first, adding terms from left to right, and then adding terms from right to left. $$1 + 1/2 + 1/3 + 1/4 + 1/5 + \cdots$$ As the sample run indicates, you may get two different sums. Can you explain why?

Sample run:

This program computes the sum of the first several terms of the harmonic series:
1 + 1/2 + 1/3 + 1/4 + 1/5 + ... from left to right and then from right to left.
-------------------------------------------------------------------------------
Enter the number of terms you would like to sum: 50000
The approximate sum when calculated left to right is 11.397003949278504
The approximate sum when calculated right to left is 11.397003949278519

Tags: java.util.Scanner, for-loop