id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

sumHarmonicSeries


Write a program that computes the following sum: sum = 1.0/1 + 1.0/2 + 1.0/3 + 1.0/4 + 1.0/5 + .... + 1.0/N N is an integer limit that is a parameter


sumHarmonicSeries(1) → 1.0
sumHarmonicSeries(2) → 1.5
sumHarmonicSeries(3) → 1.8333333333333333

...Save, Compile, Run (ctrl-enter)

public double sumHarmonicSeries(int n){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 105

Copyright Nick Parlante 2017 - privacy