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

 

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

Given an integer and a boolean, round the integer up to the next highest multiple of 10 if the boolean is true. If the boolean is false, round the integer down to the next lowest multiple of 10. If the integer is a multiple of 10, simply return that number.


upOrDown(18, true) → 20
upOrDown(18, false) → 10
upOrDown(-18, true) → -10

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

public int upOrDown( int num, boolean roundup ){ }

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 Post-solution available

Copyright Nick Parlante 2017 - privacy