programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
• Campbell Ritchie
• Jeanne Boyarsky
• Ron McLeod
• Paul Clapham
• Liutauras Vilda
Sheriffs:
• paul wheaton
• Rob Spoor
• Devaka Cooray
Saloon Keepers:
• Stephan van Hulst
• Tim Holloway
• Carey Brown
• Frits Walraven
• Tim Moores
Bartenders:
• Mikalai Zaikin

# HELP!

Greenhorn
Posts: 5
• Number of slices to send:
Optional 'thank-you' note:
"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){
}
Thank you....Vannie

Rancher
Posts: 13459
• Number of slices to send:
Optional 'thank-you' note:
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

Ranch Hand
Posts: 3695
• Number of slices to send:
Optional 'thank-you' note:
and thirdly, don't cross-post.

This is also in the "Java In General - Beginner's" forum. Where someone reminded you of High School.

 Did you see how Paul cut 87% off of his electric heat bill with 82 watts of micro heaters?