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

Thread: Almost got no idea how to do this! Need some H E L P!

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Almost got no idea how to do this! Need some H E L P!

    Can someone help me with my project. I'm a beginner when it comes to java and i picked the most complicated problem given by my instructor. Lend me some help i got no idea how to start this




    https://www.facebook.com/notes/maron...51974110985111


    Sorry if I'm asking for this, i know this is too much by i really have no idea. I only finish some of programs like right triangle, diamond and perfect numbers. But this two difficult problems that i can't
    understand well.
    Last edited by maronski; July 30th, 2012 at 03:07 PM.


  2. #2
    Member
    Join Date
    Jul 2012
    Posts
    69
    My Mood
    Relaxed
    Thanks
    1
    Thanked 6 Times in 6 Posts

    Default Re: Almost got no idea how to do this! Need some H E L P!

    Could you maybe write it out, it is very hard to read now.

  3. #3
    Administrator copeg's Avatar
    Join Date
    Oct 2009
    Location
    US
    Posts
    5,372
    Thanks
    184
    Thanked 836 Times in 779 Posts
    Blog Entries
    5

    Default Re: Almost got no idea how to do this! Need some H E L P!


  4. #4
    Junior Member
    Join Date
    Jul 2012
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Almost got no idea how to do this! Need some H E L P!

    Thank you, i appreciate your concern about me although im not following instructions. Sorry because im not so good at english and programing also. This is my first to ask help in forum like this.

  5. #5
    Member
    Join Date
    Jun 2012
    Location
    Left Coast, USA
    Posts
    451
    My Mood
    Mellow
    Thanks
    1
    Thanked 97 Times in 88 Posts

    Default Re: Almost got no idea how to do this! Need some H E L P!

    Quote Originally Posted by maronski View Post
    ... i picked the most complicated problem given by my instructor....
    That makes no sense at all to me. Why not pick some less "complicated" problems and work your way up to the Good Stuff.

    Quote Originally Posted by maronski View Post
    no idea...
    Just look the problem. Take it a step at a time. I assume that you can create text file that you can compile and execute with Java.


    Then...

     
    //Create a public class with whatever appropriate name you choose.
     
    //Here's what goes in the class:
     
    //Make three functions:
     
    static int f1(int n)
    {
        // Calculate the sum of the first n integers.
        // Maybe with a for(){} loop.
     
        // Return the square of that sum.
    } // End of f1()
     
     
    static int f2(int n)
    {
        // Calculate the value of n times (n+1) divided by 2.
     
        // Return that value.
    } // End of f2()
     
    static int f3(int n)
    {
        // Calculate the sum of the cubes of the first n integers.
        // Maybe with a for(){} loop.
     
        // Return that sum.
    } // End of f3()
     
    static void main(String [] args)
    {
        // Make a for(){} loop that lets an integer variable, n, go
        // from 1 through 20.
     
        //
        // Here's the body of that loop.
        //
        BEGIN LOOP
            // Declare integer variables sum1, sum2, sum3.
            //
            // Let sum1 = f1(n), sum2 = f2(n) and sum3 = f3(n).
            //
            // Print values of n, sum1, sum2, sum3.
        END LOOP
    } // End of main()


    Cheers!

    Z
    Last edited by Zaphod_b; July 30th, 2012 at 03:36 PM.

  6. The Following User Says Thank You to Zaphod_b For This Useful Post:

    jps (July 30th, 2012)

  7. #6
    Junior Member
    Join Date
    Jul 2012
    Posts
    22
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Re: Almost got no idea how to do this! Need some H E L P!

    Big help to start with. We're about to pick randomly by our instructor. I've just got no luck. By the way, thank you. Probably I'm not good at programming but it's required for us to do this. Thanks a lot.

  8. #7
    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: Almost got no idea how to do this! Need some H E L P!

    Quote Originally Posted by Zaphod_b View Post
    ...
     
    //Create a public class with whatever appropriate name you choose.
     
    //Here's what goes in the class:
     
    //Make three functions:
     
    static int f1(int n)
    {
        // Calculate the sum of the first n integers.
        // Maybe with a for(){} loop.
     
        // Return the square of that sum.
    } // End of f1()
     
     
    static int f2(int n)
    {
        // Calculate the value of n times (n+1) divided by 2.
     
        // Return that value.
    } // End of f2()
     
    static int f3(int n)
    {
        // Calculate the sum of the cubes of the first n integers.
        // Maybe with a for(){} loop.
     
        // Return that sum.
    } // End of f3()
     
    static void main(String [] args)
    {
        // Make a for(){} loop that lets an integer variable, n, go
        // from 1 through 20.
     
        //
        // Here's the body of that loop.
        //
        BEGIN LOOP
            // Declare integer variables sum1, sum2, sum3.
            //
            // Let sum1 = f1(n), sum2 = f2(n) and sum3 = f3(n).
            //
            // Print values of n, sum1, sum2, sum3.
        END LOOP
    } // End of main()


    Cheers!

    Z
    Cool of you to take the time for that for someone
    Two thumbs up for nice people

Similar Threads

  1. Need loop idea please!
    By Montrell79 in forum Loops & Control Statements
    Replies: 8
    Last Post: March 15th, 2012, 02:27 PM
  2. No idea how to fix it.
    By Hammer67 in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 13th, 2011, 11:41 AM
  3. Blog idea
    By dks in forum Java Theory & Questions
    Replies: 3
    Last Post: February 17th, 2011, 02:48 PM
  4. need help with my idea!
    By frostwing in forum Object Oriented Programming
    Replies: 3
    Last Post: February 10th, 2011, 09:53 AM
  5. No idea what to do for this
    By jwb4291 in forum What's Wrong With My Code?
    Replies: 7
    Last Post: July 18th, 2010, 08:16 PM