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

 

sumSeries


Define a function that when passed the parameters of an arithmetic progression, namely, the value of the first item, the change from one value to the next, and the next of terms, returns the sum of the series. For example, 10, 2, 3 represents a series of 3 items starting at 10 and each item is 2 more than the one before. Mathematically, this can be done without a loop as well.


sumSeries(1, 1, 10) → 55
sumSeries(1, 2, 5) → 25
sumSeries(10, 2, 3) → 36

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

int sumSeries(int start, int change, 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: 2 Post-solution available

Copyright Nick Parlante 2017 - privacy