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

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

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

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

6. ## 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. ## 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. ## 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. ## 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

10. ## 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. ## 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.