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

 

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

Write a method that finds the "crazy sum" between two integers. The "crazy sum" is the sum of all the squares of all the integers from low to high. For example, if low is 3 and high is 5, you would calculate the sum of three squared plus four squared plus five squared, which is 9+16+25. So you would return 50. As preconditions, 0<=low<=high and the sum will not exceed the maximum integer value in Java.


ggg1CrazySum(1, 1) → 1
ggg1CrazySum(0, 3) → 14
ggg1CrazySum(14, 24) → 4081

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

public int ggg1CrazySum(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: 250

Copyright Nick Parlante 2017 - privacy