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

 

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

Write a method that has parameters 'num' and 'zeros'. Return an integer value that has 'zeros' number of zeros at the end of 'num'. For example, if 'num' is 312 and 'zeros' is 2 you would return 31200. Look at the test data for further examples. As preconditions you may assume that 'num' is positive, 'zeros' is non-negative, and that the result will still be small enough to return as an integer without overflow or wrap-around. You may NOT use any strings or arrays in solving this problem!


quiz2020_12_02_APP1SLHL_addZeros(45, 3) → 45000
quiz2020_12_02_APP1SLHL_addZeros(7801, 2) → 780100
quiz2020_12_02_APP1SLHL_addZeros(4892, 0) → 4892

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

public int quiz2020_12_02_APP1SLHL_addZeros(int num, int zeros) { }

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

Copyright Nick Parlante 2017 - privacy