Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

4. 60 points) Consider the following classes: Point Circle center: Point radius : real x: real y: real +gex): real +getY0:real +setX(reall :void +sety(real): void

image text in transcribed

4. 60 points) Consider the following classes: Point Circle center: Point radius : real x: real y: real +gex): real +getY0:real +setX(reall :void +sety(real): void + getCenter): Point +getRadiuso: real +setCenter(Point): void setRadius(real) :void +distance(Point): real + 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 retums a Boolean value ind cating 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 radi 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 complers for these languages online

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Question 15 Find F(2). f(t) = t3/2 0 1 25 C) 0 10 C) 0 48 C) 0 23

Answered: 1 week ago

Question

U11 Informing Industry: Publicizing Contract Actions 317

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago