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

 

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

Write a method that accepts a number 'num' and a divisor 'div'. Return a string that tells the answer you get when 'num' is divided by 'div', using the old-school form of division where remainders are reported out. For example, if 'num' is 53 and 'div' is 5, you would return "10 remainder 3" because 5 goes into 53 ten times with a remainder of 3. Look at the test data for more examples. As a precondition you may assume that both 'num' and 'div' will be positive integers.


test2021_02_11_APP1SLHL_longDivision(17, 3) → "5 remainder 2"
test2021_02_11_APP1SLHL_longDivision(80, 10) → "8 remainder 0"
test2021_02_11_APP1SLHL_longDivision(412, 6) → "68 remainder 4"

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

public String test2021_02_11_APP1SLHL_longDivision(int num, int div) { }

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

Copyright Nick Parlante 2017 - privacy