Question
make a class (in java) called Point and another one called ExtendedCircle. There also has to be a class called ExtendedCircleTest to test all of
make a class (in java) called Point and another one called ExtendedCircle. There also has to be a class called ExtendedCircleTest to test all of this
I would really appreciate any kind of help because I am stuck. This is for Java.
I will try to only provide one piece of the code for each question, since I don't want to overwork you guys and I appreciate the help!
Point class has to have points in the format of (x,y) Point class needs to include
- x and y coordinates that are instance variables using int types for the variables - two constructors. a default one and a two-parameter. The default has to set the x and y coords to 0 and the two parameter has to include a given x and y as parameters - the x and y coordinates should include get/set methods - toString method should be included and should return a string in the format of "(x,y)" - distance should be included as a method to calculate the distance between one point and another. example ) it takes one parameter of (point type) and returns a double value (math.sqrt method can be used to calculat square root) - equals method needs to be included with 1 parameter of object type returning boolean value. two points are equal if they have the same x and y coords
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Java public class Point private int x private int y Default constructor sets x and y to 0 public Poi...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started