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

 

dsawyer@methacton.org intro_p4_level_3 > getEmAll
prev  |  next  |  chance

Given a positive integer and a boolean with a value of true, return the sum of all the numbers between 1 and 1,000 (inclusive at both ends) that are multiples of that number. If the boolean parameter is false, return the sum of all the numbers between 1 and 1,000 that are not multiples of the number.


getEmAll(1, true) → 500500
getEmAll(1, false) → 0
getEmAll(2, true) → 250500

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

public int getEmAll( int num, boolean multiples ){ }

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

Copyright Nick Parlante 2017 - privacy