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

Thread: Hi Fellow

  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    8
    My Mood
    Amazed
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs down Hi Fellow

    will you pls help me on how to create program in java that will ask for two numbers, num and n,and then returns the nth root of num.


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts
    If you don't understand my answer, don't ignore it, ask a question.

  3. #3
    Junior Member
    Join Date
    Sep 2013
    Posts
    8
    My Mood
    Amazed
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Hi Fellow

    String input = console.readLine("Please enter your first number:");
    int newinput = Integer.parseInt(input);
    String input2 = console.readLine("Please enter your second number: ");

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Hi Fellow

    That's a start. Now put that code in a method in a class, compile it and execute it and see what happens.

    When posting code please wrap your code with code tags:
    [code=java]
    <YOUR CODE HERE>
    [/code]
    to get highlighting and preserve formatting.
    If you don't understand my answer, don't ignore it, ask a question.

  5. #5
    Junior Member
    Join Date
    Sep 2013
    Posts
    8
    My Mood
    Amazed
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Hi Fellow

    Now i have been trying this but still can't work

    String input = console.readLine("Please enter your first number:");
    int newinput = Integer.parseInt(input);
    String input2 = console.readLine("Please enter your second number: ")

    double Result = Math.pow();
    if (n==0)
    {
    return1.0 ;
    }
    return x*pow (x,n-1);

  6. #6
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,140
    Thanks
    65
    Thanked 2,720 Times in 2,670 Posts

    Default Re: Hi Fellow

    Please post a complete program and wrap it in code tags. What you have posted is incomplete.
    If you don't understand my answer, don't ignore it, ask a question.

Similar Threads

  1. Hello Fellow Programmers
    By Linwizzle in forum Member Introductions
    Replies: 1
    Last Post: August 18th, 2013, 02:35 PM
  2. Hi fellow programmers
    By darey in forum Member Introductions
    Replies: 4
    Last Post: August 14th, 2012, 06:57 AM
  3. Hello, fellow programmers!
    By awinston in forum Member Introductions
    Replies: 0
    Last Post: July 25th, 2012, 07:47 PM
  4. Hello Fellow Java-ers :P
    By 12sea21 in forum Member Introductions
    Replies: 8
    Last Post: August 24th, 2011, 09:56 AM
  5. Hello Fellow Programmers
    By mspray in forum Member Introductions
    Replies: 0
    Last Post: February 20th, 2010, 09:10 PM