# [java] Problem with divisor program++fixed++

This topic is 4485 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Alright...I'm working on a program for a summer assignment, and I need some help with it... I have to write a program that takes a positive integer as an input and displays a message box that includes wether or not the number is perfect, deficient, or abundent. I was given two methods to use... boolean isDivisor (int number, int divisor) and... int divisorSum (int number) A perfect number being a number that the sum of the divisors equals the number. 28 = 1+2+4+7+14 as an example of a perfect number. If the sum of the divisors is less than the number, it is deficient, if it is greater than the number, it is abundant. The part i'm having trouble with is using the methods, and also the math part of the problem. Many thanks in advance, Kyokai ++i got it figured out++ [Edited by - kyokai on September 6, 2006 9:24:56 PM]

##### Share on other sites
Do you have to write these functions, or are they already available?

##### Share on other sites
Note that we can't help with homework. Not sure if this is for a class or not, so here's some vague suggestion:

I'd start off by finding all divisors of the given number.

Edit: And just for clarification, are you counting 1 as a divisor? Are you counting a number as it's own divisor? Looks like yes then no for those questions, respectively, but just double checking.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5

• 13
• 26
• 10
• 11
• 9
• ### Forum Statistics

• Total Topics
633736
• Total Posts
3013600
×