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 4 of 4

Thread: homeework :(

  1. #1
    Junior Member
    Join Date
    May 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default homeework :(

    Karl Gauss had an algorithm that was more efficient than a for loop for summing the numbers 1 through N. To sum the numbers he used N ( N + 1 ) / 2

    Write a program with two java Methods: one to calculate the sum with a for loop and the other using Gauss’s formula. Make calls to the two methods from the main Method.

  2. #2
    Junior Member
    Join Date
    Nov 2012
    Location
    Kolkata, India
    Posts
    8
    My Mood
    Cool
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: homeework :(

    This'll work

    -Code removed-
    Last edited by jps; May 17th, 2013 at 11:40 PM. Reason: Spoonfeeding

  3. #3
    Super Moderator jps's Avatar
    Join Date
    Jul 2012
    Posts
    2,642
    My Mood
    Daring
    Thanks
    90
    Thanked 263 Times in 232 Posts

    Default Re: homeework :(

    @edderz87 Welcome to the forum. We are happy to help you complete your assignment but no one is here to do it for you.
    @KaustavBanerjee Please see The problem with spoonfeeding

  4. #4
    Member llowe29's Avatar
    Join Date
    Jul 2013
    Posts
    116
    My Mood
    Tired
    Thanks
    9
    Thanked 5 Times in 5 Posts

    Default Re: homeework :(

    no spoonfeeding.