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

 

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

A number is said to be Lisarmium if the sum of its digits raised to their respective positions is the number itself. For this purpose, the positions start at the left end of the number. For example, 752 has 7 in the first position, 5 in the second position, and 2 in the third position. So to be a lisarmium number 7^1+5^2+2^3 would have to equal 752, which it does not. Therefore 752 is NOT a lisarmium number. However, 135 IS a lisarmium number because 1^1+3^2+5^3=135. Write a method that returns 'true' if 'num' is a lisarmium number and 'false' otherwise.


test2020_11_12_P1SLHL_lisarmium(89798) → false
test2020_11_12_P1SLHL_lisarmium(891247) → false
test2020_11_12_P1SLHL_lisarmium(135) → true

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

public boolean test2020_11_12_P1SLHL_lisarmium(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: 290

Copyright Nick Parlante 2017 - privacy