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.
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.
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.
Re: Math Fromula y=x2+6x+5 how to convert to Java Programming code
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
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.
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.
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
Re: Math Fromula y=x2+6x+5 how to convert to Java Programming code
Well, that's shame, x^2 is simply x*x.
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.