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

 

roundedOff


In an imaginary economy, all amounts get rounded off to the nearest multiple of 100. Define a function that when passed an integer representing an amount, returns the rounded-off amount. Note: Brownie points if you do it without any condition :)


roundedOff(199) → 200
roundedOff(150) → 200
roundedOff(149) → 100

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

int roundedOff(int n) { }

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

Copyright Nick Parlante 2017 - privacy