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

 

jebbert@volusia.k12.fl.us > capeSumNums
prev  |  next  |  chance

Write a method that accepts two integer parameters low and high such that low<=high. Return the sum of all the integers from low to high, inclusive. For example, if low=3 and high=5 return 12 since 3+4+5=12. The sum will always be small enough that is can be stored as an integer.


capeSumNums(1, 4) → 10
capeSumNums(-8, 8) → 0
capeSumNums(3, 5) → 12

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

public int capeSumNums(int low, int high) { }

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: 290

Copyright Nick Parlante 2017 - privacy