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.

New to Java I am a bit puzzled with my code

Hello Everyone!
I am new to Java and this site as well, I am in a computer science course at my university and we are being asked to solve math problems. I know my code is not correct, however our professor was not too clear on how to write it.. this is what I have so far

I am solving for distance and slope of two points, If you do give me the answer to correcting my code please explain why so I could take note for future reference. Thank you so much for all of your help.

Re: New to Java I am a bit puzzled with my code

Originally Posted by Elle_Le_Belle

Hello Everyone!
I am new to Java and this site as well, I am in a computer science course at my university and we are being asked to solve math problems. I know my code is not correct, however our professor was not too clear on how to write it.. this is what I have so far

I am solving for distance and slope of two points, If you do give me the answer to correcting my code please explain why so I could take note for future reference. Thank you so much for all of your help.

Answer:
first of all the variables should not start with capital letters...(X1,X2)..and try with (x1-x2) and (y1-y2) instead of (x2-x1) and (y2-y1) respectively..all d best...and please let me know if my answer has any worth for you.. Jay...:-)

Re: New to Java I am a bit puzzled with my code

First of all the variables should not start with capital letters...(X1,X2)..and try with (x1-x2) and (y1-y2) instead of (x2-x1) and (y2-y1) respectively..all d best...and please let me know if my answer has any worth for you.. Jay...
:-)

Re: New to Java I am a bit puzzled with my code

i m again telling you dat try wid (x1-x2) n (y1-y2) instead of (x2-x1) n (y2-y1)...it will be more suitable for ur particular question...n equation will remain same in both the ways..so just try dat...ok?

Re: New to Java I am a bit puzzled with my code

Originally Posted by Jay_20991

i m again telling you dat try wid (x1-x2) n (y1-y2) instead of (x2-x1) n (y2-y1)...it will be more suitable for ur particular question...n equation will remain same in both the ways..so just try dat...ok?

Wtf? The order of the values does not matter as long as they are consistent.

And please try to use proper spelling and grammar. Many of our users have a non-English first language, so it can be pretty difficult to translate words like "ur" or "dat" or "wid".