Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Important note :- The following problem needs to solved only using Ruby Point Circle xreal y: real -center Point radius: real + getx) real +
Important note :- The following problem needs to solved only using Ruby
Point Circle xreal 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 + getAreal 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 cirdle, 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. Point Circle xreal 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 + getAreal 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 cirdle, 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 onlineStep by Step Solution
There are 3 Steps involved in it
Step: 1
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