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

 

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

Write a method that returns TRUE if it IS possible to get the targetSum from some combination of low and high being passed into the crazySum method. For example, the target sum 16 can be reached by calling crazySum(4,4) which returns 16. The target sum 6 cannot be reached because no combination of low and high values passed into crazySum will produce a result of 6. Be careful! You could easily get a stack overflow if you are not careful. I will keep the target sums small enough that you should not have any problems if you are careful. Remember that you can use the 'Math' methods to perform some simple math operations.


ggg3CrazySumPossible(61) → true
ggg3CrazySumPossible(1) → true
ggg3CrazySumPossible(0) → true

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

public boolean ggg3CrazySumPossible(int targetSum) { }

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

Copyright Nick Parlante 2017 - privacy