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

 

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

Write a method that determines the "flurb" of a positive integer. The "flurb" is always a single-digit. To find the flurb of a number, add the digits of the number in a funny and call this the "funny sum" as described below: Each digit is worth its numeric value times its place in the number. For example, in the number 472, the 4 is in the 3rd place, the 7 in the 2nd place, and the 2 is in the 1st place. So the "funny sum" of 472 is 4*3 + 7*2 + 2*1 = 12 + 14 + 2 = 28. When calculating the flurb of a number, you continue to "flurberize" the "funny sum" until you get a single-digit number. For example, flurb(472)=flurb(28)=flurb(12)=flurb(4) and the flurb of a single-digit number is just that number, so the flurb of 472 is 4.


flurb(5) → 5
flurb(7) → 7
flurb(14) → 6

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

public int flurb(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: 410

Copyright Nick Parlante 2017 - privacy