Results 1 to 3 of 3
Thread: Test quality of number
 10122014, 09:54 AM #1Member
 Join Date
 Oct 2014
 Posts
 2
 Rep Power
 0
Test quality of number
Guys! Help me please :(
I Dont know what to do :(
Problem 2: (Perfect.java)
Write a Java program that reads a positive, nonzero integer as input and checks if the integer is deficient, perfect, or abundant.
A positive, nonzero integer, N, is said to be perfect if the sum of its positive proper divisors (i.e., the positive integers, other than N itself, that divide N exactly) is equal to the number itself. If this sum is less than N, the number is said to be deficient. If the sum is greater than N, the number is said to be abundant.
For example, the number 6 is perfect, since 6 = 1 + 2 + 3, the number 8 is deficient, since 8 > 1 + 2 + 4, while the number 12 is abundant, since 12 < 1 + 2 + 3 + 4 + 6.
Sample Output:
Input N: 5
5 is deficient.
Input N: 6
6 is perfect.
Input N: 18
18 is abundant.
 10122014, 10:05 AM #2
 Join Date
 Sep 2008
 Location
 Voorschoten, the Netherlands
 Posts
 14,422
 Blog Entries
 7
 Rep Power
 28
 10122014, 02:02 PM #3
Similar Threads

How to test for an odd/even number
By counterfox in forum New To JavaReplies: 7Last Post: 04152010, 03:52 AM
Bookmarks