Results 1 to 3 of 3
  1. #1
    Lloydaaa is offline Member
    Join Date
    Oct 2014
    Posts
    2
    Rep Power
    0

    Default 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, non-zero integer as input and checks if the integer is deficient, perfect, or abundant.
    A positive, non-zero 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.

  2. #2
    JosAH's Avatar
    JosAH is offline Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    14,422
    Blog Entries
    7
    Rep Power
    28

    Default Re: Pls help me idnk what to do :((

    Quote Originally Posted by Lloydaaa View Post
    I Dont know what to do :(
    Study the Java language?

    kind regards,

    Jos
    Build a wall around Donald Trump; I'll pay for it.

  3. #3
    Norm's Avatar
    Norm is offline Moderator
    Join Date
    Jun 2008
    Location
    Eastern Florida
    Posts
    20,003
    Rep Power
    33

    Default Re: Test quality of number

    What have you tried?
    Be sure to wrap and code you post in code tags.
    If you don't understand my response, don't ignore it, ask a question.

Similar Threads

  1. How to test for an odd/even number
    By counterfox in forum New To Java
    Replies: 7
    Last Post: 04-15-2010, 03:52 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •