Ask Me Help Desk

Ask Me Help Desk (https://www.askmehelpdesk.com/forum.php)
-   Universities & Colleges (https://www.askmehelpdesk.com/forumdisplay.php?f=399)
-   -   Java Application (https://www.askmehelpdesk.com/showthread.php?t=775393)

  • Nov 16, 2013, 09:10 AM
    cycloner93
    Java Application
    How to do this?

    Design a java class named MyPoint to represent a point with x- and y-coordinates. The class contains:
    Two data fields x and y that represent the x- and y-coordinates.
    A no-argument constructor that creates a point (0, 0).
    A constructor that constructs a point with specified coordinates.
    Two get methods for data fields x and y, respectively.
    A method named distance that returns the distance from this point to another point of MyPoint type.
    A method named distance that returns the distance from this point to another point of MyPoint with specified x- and y-coordinates.
    toString method that displays the coordinate of x and y.
  • Nov 16, 2013, 09:14 AM
    Curlyben
    What do YOU think ?
    While we're happy to HELP we wont do all the work for you.
    Show us what you have done and where you are having problems..
  • Nov 16, 2013, 09:25 AM
    cycloner93
    I am sorry I am really very bad in coding -.-" This is only what I did.

    class MyPoint {

    int x,y;

    }

    MyPoint() {
    x=0;
    y=0;
    }

    int getX() {
    return x;
    }

    int getY() {
    return y;
    }
  • Nov 16, 2013, 09:36 AM
    cycloner93
    Quote:

    Originally Posted by Curlyben View Post
    What do YOU think ?
    While we're happy to HELP we wont do all the work for you.
    Show us what you have done and where you are having problems..

    I am sorry I am really very bad in coding -.-" This is only what I did.

    class MyPoint {

    int x,y;

    }

    MyPoint() {
    x=0;
    y=0;
    }

    int getX() {
    return x;
    }

    int getY() {
    return y;
    }

  • All times are GMT -7. The time now is 07:56 AM.