Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 3 of 3

Thread: Perfect Number Java Loop Problem - Please Help!?

  1. #1
    Junior Member
    Join Date
    Nov 2011
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Perfect Number Java Loop Problem - Please Help!?

    The problem reads a perfect number is defined as a positive integer which is the sum of its proper divisors. Or in other words, the sum of the positive divisors excluding itself. The first perfect number is 6 because 1 + 2 + 3 = 6. The next perfect number is 28 because 1+2+4+7+14= 28. Write a program that takes in a number from the user and prints out whether their number is perfect or not. If it is perfect the display the summation equation. Otherwise, simply state that it is not perfect.

    Please help. I'm so confused.


  2. #2
    Super Moderator helloworld922's Avatar
    Join Date
    Jun 2009
    Posts
    2,895
    Thanks
    23
    Thanked 619 Times in 561 Posts
    Blog Entries
    18

    Default Re: Perfect Number Java Loop Problem - Please Help!?

    What are you confused on? What have you done so far (i.e. code)?

    If you're not sure where to start, I suggest reading The Java™ Tutorials.

  3. #3
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Perfect Number Java Loop Problem - Please Help!?

    First you need to come up with the algorithm to solve the problem.
    Take a paper and pencil and figure out how to solve the problem, or ask google.

    When you have an algorithm for solving the problem, then try writing a program to solve it. When you have problems getting the code to work, post it here with your questions.

Similar Threads

  1. [SOLVED] Problem using the length of a string to bound the number of iterations of a for loop
    By dtitt3 in forum Loops & Control Statements
    Replies: 1
    Last Post: November 3rd, 2011, 01:44 PM
  2. Do Loop, Reversing a Number Example, Incorrect Code in Book?
    By djl1990 in forum Loops & Control Statements
    Replies: 3
    Last Post: October 24th, 2011, 07:01 AM
  3. Loop to note position of lowest number
    By fortune2k in forum Loops & Control Statements
    Replies: 3
    Last Post: November 23rd, 2010, 10:05 AM
  4. Java Do..while loop problem
    By jwill22 in forum Loops & Control Statements
    Replies: 4
    Last Post: November 13th, 2010, 04:02 AM
  5. Can a for loop work with random number?
    By humdinger in forum Loops & Control Statements
    Replies: 7
    Last Post: January 10th, 2010, 10:06 PM