Ask Experts Questions for FREE Help !
Ask
    cycloner93's Avatar
    cycloner93 Posts: 3, Reputation: 1
    New Member
     
    #1

    Nov 16, 2013, 09:10 AM
    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.
    Curlyben's Avatar
    Curlyben Posts: 18,514, Reputation: 1860
    BossMan
     
    #2

    Nov 16, 2013, 09:14 AM
    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..
    cycloner93's Avatar
    cycloner93 Posts: 3, Reputation: 1
    New Member
     
    #3

    Nov 16, 2013, 09:25 AM
    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;
    }
    cycloner93's Avatar
    cycloner93 Posts: 3, Reputation: 1
    New Member
     
    #4

    Nov 16, 2013, 09:36 AM
    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;
    }

Not your question? Ask your question View similar questions

 

Question Tools Search this Question
Search this Question:

Advanced Search

Add your answer here.


Check out some similar questions!

Java Application [ 3 Answers ]

I created small application where I choose five numbers randomly if they are divisible by 2 I won the game if not I lose . My question I want to tweak it .If I get three number divisible by 2 I won the game and if not I lose it . This is code : import java .util.Random ; public class...

Java netbeans program- Connection between java and mysql,How to conn [ 0 Answers ]

which I wrote from a book but when I run it, it shows exception please give me the code to connect jlistbox to database when I click on btn1. btn coding should search "name" in database and shows all the names in listbox my coding: here-- r1,r2,r3 are radio btns and l1,l2,l3 are labels,...

Write a JAVA application in a client/server environment. [ 1 Answers ]

Write a JAVA application that allows users to update their personal information in a database in a client/server environment. Windows: Window 1: Window1 should allow the user to select between two options ADD or UPDATE. It should contain two buttons and based on the user selection the user...


View more questions Search