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

 

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

Write a method that returns the value of 'num' but with the ones place of 'num' replaced with a zero. For example, if 'num' is 7482, return 7480. If 'num' is -23, return -20. If 'num' only has one digit, you will return 0. You are NOT allowed to use any strings or arrays to solve this problem! Look at the test data for examples.


test2023_10_05_APP1SLHL_zeroOnesPlace(9) → 0
test2023_10_05_APP1SLHL_zeroOnesPlace(-3) → 0
test2023_10_05_APP1SLHL_zeroOnesPlace(574) → 570

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

public int test2023_10_05_APP1SLHL_zeroOnesPlace(int num) { }

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

Copyright Nick Parlante 2017 - privacy