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

• September 14th, 2013, 12:11 PM
FreeMan0001
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.
• September 14th, 2013, 12:14 PM
FreeMan0001
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.
• September 14th, 2013, 12:23 PM
GregBrannon
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.
• September 14th, 2013, 01:35 PM
jps
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 double post your questions.
• September 14th, 2013, 03:57 PM
Norm
Re: Math Fromula y=x2+6x+5 how to convert to Java Programming code
• September 15th, 2013, 06:07 AM
FreeMan0001
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
• September 15th, 2013, 06:19 AM
GregBrannon
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.
• September 15th, 2013, 06:57 AM
FreeMan0001
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.
• September 15th, 2013, 07:28 AM
Norm
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
• September 17th, 2013, 02:44 PM
startas
Re: Math Fromula y=x2+6x+5 how to convert to Java Programming code
Well, that's shame, x^2 is simply x*x.
• October 18th, 2013, 10:14 AM
ISHAQ KIYAWA
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.