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

 

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

Write a method that accepts three single-digit non-negative integers, 'hundreds', 'tens', and 'ones'. Each of these parameters contains a single non-negative digit that represents a place-value in a base 10 number (the kind of numbers you have been using your whole life). Return a single integer value that is equal to the value represented by these place-value digits. For example, if 'hundreds' is 5, 'tens' is 2, and 'ones' is 7, that means we are trying to represent the number 527, so return that value. As preconditions, you may assume that each of the parameters only contains a single digit 0, 1, 2, 3, 4, 5, 6, 7, 8, or 9. Note: If leading digits are zeros, those digits will not appear in the final answer. For example, if 'hundreds' is 0, 'tens' is 0, and 'ones' is 5, you will just return the value 5. If 'hundreds' is 0, 'tens' is 3, and 'ones' is 1, you will return the value 31. Look at the test data for further examples.


test2022_10_13_APP1SLHL_makeNum(5, 3, 1) → 531
test2022_10_13_APP1SLHL_makeNum(8, 0, 2) → 802
test2022_10_13_APP1SLHL_makeNum(0, 0, 0) → 0

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

public int test2022_10_13_APP1SLHL_makeNum(int hundreds, int tens, int ones) { }

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