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

Thread: Math Fromula y=x2+6x+5 how to convert to Java Programming code

  1. #1
    Junior Member
    Join Date
    Sep 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Math Fromula y=x2+6x+5 how to convert to Java Programming code

    Hello
    every one i am new in Java Programming,
    how i need to convert this ( y=x2+6x+5 and second one: x2+x3+6x-5 ) to Java Programming code
    there any one who help me regarding this Problem.

    Thanks alot.


  2. #2
    Junior Member
    Join Date
    Sep 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Algorithms Code Problem

    Hello
    i am new in Java Programming,
    how i need to convert this ( y=x2+6x+5 and second one: x2+x3+6x-5 ) to Java Programming code
    there any one who help me regarding this Problem.

    Thanks alot.

  3. #3
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Math Fromula y=x2+6x+5 how to convert to Java Programming code

    Please make an attempt to write the code and come back when you have code to share and questions that we can help you with. You might start by reviewing Java arithmetic operators, but I don't know what you don't know. Having your code attempt will answer that.

  4. #4
    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: Algorithms Code Problem

    It looks like valid java syntax to me (given the right context), what seems to be the trouble?

    Please do not piggy-back your questions on zombie threads.
    Please do not double post your questions.

  5. #5
    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: Math Fromula y=x2+6x+5 how to convert to Java Programming code

    If you don't understand my answer, don't ignore it, ask a question.

  6. #6
    Junior Member
    Join Date
    Sep 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Math Fromula y=x2+6x+5 how to convert to Java Programming code

    Hello GregBrannon Thanks for replay.

    Mr.GregBrannno That is main problem i don't know how to write this " y=x2+6x+5 " in Java codes. I don't know that when i know it how to do in codes i will never come here for help. So please when you can help me regarding this " y=x2+6x+5 " how to write in java Codes I will be your greatfull.

    Thanks alot

  7. #7
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,517
    My Mood
    Mellow
    Thanks
    215
    Thanked 698 Times in 680 Posts

    Default Re: Math Fromula y=x2+6x+5 how to convert to Java Programming code

    Did you read the info at the link I provided? If so, what is the operator for multiplying two numbers?

    The equation you most recently posted is probably more accurately written as:

    y = x^2 + 6x + 5

    where "x^2" means "x squared or x to the second power" and "6x" means "6 times x". Do you agree? If so, take that understanding to the link I provided and rewrite the equation using Java arithmetic operators.

    Make an effort and come back, showing your work and asking any questions you have. We can't do it for you, but we can help.

  8. #8
    Junior Member
    Join Date
    Sep 2013
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Math Fromula y=x2+6x+5 how to convert to Java Programming code

    Thanks help.
    x2 means: 2 is power of x. so my question how i will declare in java language x power 2, which operater i used for that to solve my problem.

  9. #9
    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: Math Fromula y=x2+6x+5 how to convert to Java Programming code

    The link in post#3 gives the operators available in java. Not all the arithmetic operators are there. Some operations are done by methods in the Math class. Read the API doc for the Math class available at this link:
    Java Platform SE 7
    If you don't understand my answer, don't ignore it, ask a question.

  10. #10
    Member
    Join Date
    Aug 2013
    Posts
    37
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Re: Math Fromula y=x2+6x+5 how to convert to Java Programming code

    Well, that's shame, x^2 is simply x*x.

  11. #11
    Junior Member
    Join Date
    Oct 2013
    Location
    Kiyawa
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Math Fromula y=x2+6x+5 how to convert to Java Programming code

    You may also use Math.pow(x,2) this means x power 2.

Similar Threads

  1. how to convert this my PHP code 'send post request' to java
    By mr.msds in forum What's Wrong With My Code?
    Replies: 3
    Last Post: March 9th, 2013, 05:03 AM
  2. [SOLVED] How to convert this pseudo code into JAVA
    By MUSKAAN DUTT in forum What's Wrong With My Code?
    Replies: 1
    Last Post: March 2nd, 2013, 09:36 AM
  3. [SOLVED] How to convert from string to math sign
    By usama8800 in forum Java Theory & Questions
    Replies: 4
    Last Post: June 29th, 2012, 08:37 AM
  4. Convert C/C++ code to Java
    By cristianll in forum What's Wrong With My Code?
    Replies: 13
    Last Post: November 14th, 2009, 02:43 AM
  5. Convert Java Program to Java ME code
    By rinchan11 in forum Java ME (Mobile Edition)
    Replies: 1
    Last Post: October 5th, 2009, 10:18 PM