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

 

andersoniii.edwin@cusd80.com > blackHoleTwoDigit
prev  |  next  |  chance

blackHoleTwoDigit Write the method to receive a two digit number (where the digits are distinct.) and counts the number of repetitions needed to transform the given number sum of the two digits into the value 9. Make 2 two digit numbers and subtract the smaller number from the larger (example: Given 83 new number 38 - next subtract - difference is 45 repeat the process 45 and 54 (54-45=9) Conclusion the process required two subtractions and will (always) end with 9)(contributed problem by Harry Zhao.)


blackHoleTwoDigit(90) → 5
blackHoleTwoDigit(89) → 1
blackHoleTwoDigit(87) → 1

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

public int blackHoleTwoDigit(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: 110

Copyright Nick Parlante 2017 - privacy