Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

I'm having trouble with harmonic series in java. The method I'm supposed to fill in retrieves an Epsilon and based on that returns the sum of the series. The problem is, my sum is a tiny bit off. What am I doing wrong?

OpenStudy (anonymous):

OpenStudy (lyrae):

You are supposed to add terms of 1/n until the next term smaller than epsilon. In the code you provided you're trying to add epsilon terms instead, which should be impossible since epsilon is a number smaller than 1 and n is an integer. You can find a working solution here: https://ideone.com/AShPIX

OpenStudy (anonymous):

Yeah I got it to work, but that's a pretty good solution. Thankss

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!