Question: Note :- Should be solved only using Ruby language 4. (60 points) Consider the following classes: Point Circle x: real Y: real center: Point -
Note :- Should be solved only using Ruby language

4. (60 points) Consider the following classes: Point Circle x: real Y: real center: Point - radius: real +getx) : real +getY): real +setX(real): void + setY(real void + distance(Point): real +getCenter) Point +getRadius():real +setCenter(Point) void + setRadius(real void +getArea(): real +getCircumference real intersects(Circle):boolean The first class represents a 2D point. The x and y fields represent the x and y coordinates of the point. The method distance returns the distance between the point and an argument Point object. The second class represents a 2D circle. The center field is a point object representing the circle's center point. The radius field represents the radius of the circle. The getArea() and getCircumference methods calculate and return the circle's area and circumference, respectively. Finally, the intersects methods returns a Boolean value indicating if the circle intersects an argument Circle object. This can be determined by comparing the distance between the center points to the sum of the radii. Your task is to write the following program in three different object-oriented languages. Your program should create two circle objects. The first should be centered at (2, 5) with a radius of 4 The second should be centered at (10, -3) with a radius of 7. Your program should print the area of each circle, the circumference of each circle, the distance between the two center points, and indicate if the circles intersect. The three object-oriented languages you should use are Java, C++, and Ruby. As with Assignment #2, you should be able to find compilers for these languages online
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
