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

 

norm.krumpe@muohio.edu > numberType
prev  |  next  |  chance

The "proper factors" of integer n are all the factors of n that are less than n. So, the factors of 10 are 1, 2, 5, and 10, but the proper factors of 10 are just 1, 2, and 5. A number n is "abundant" if its proper factors add up to more than n. n is "deficient" if its proper factors add up to less than n. n is "perfect" if its proper factors add up to exactly n. Given a positive integer, return whether the number is abundant, deficient, or perfect.


numberType(4) → "deficient"
numberType(6) → "perfect"
numberType(12) → "abundant"

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

String numberType(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: 200

Copyright Nick Parlante 2017 - privacy