Win a copy of Murach's Python Programming this week in the Jython/Python forum!
    Bookmark Topic Watch Topic
  • New Topic

HELP!  RSS feed

 
Vannie Vo
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Report post to moderator
I need help on this java problem, can anyone please help me???:
"Suppose we have this Point Class"
public class Point {
int X;
int Y;
Point(int w, int h){
X = w;
Y = h;
//finish this method that computes the distance
//between this Point and an x and y coordinat.
public double distance(int w, int h) {
//Your code here. Any suggestions anyone?
}
----------------------------------------------
Another problem related to the problem above:
"Create a method called distance that looks like this. This is part of the Point class"
public double distance(Point p){
//Your code here
}
Thank you....Vannie
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
Vannie,
Firstly, it is good practice to be more descriptive in your subject titles. This helps us to help you, so it's in your own favour.
Secondly, this looks remarkably like homework. We don't like doing people's homework for them. Did you have a more specific question you'd like answered rather than "Please do my homework"?
eg Title: Distance in 2 dimensions
Given two points, (x1, y1) and (x2, y2), how do I find the distance between them?
thanks,
Dave
 
Mike Curwen
Ranch Hand
Posts: 3695
IntelliJ IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Report post to moderator
and thirdly, don't cross-post.

This is also in the "Java In General - Beginner's" forum. Where someone reminded you of High School.
 
    Bookmark Topic Watch Topic
  • New Topic
Boost this thread!