Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Every circle has a center and radius. Given the radius, we can determine the circle's area and circumference. Given the center, we can determine its

Every circle has a center and radius. Given the radius, we can determine the circle's area and circumference. Given the center, we can determine its position in the x-y plane. The center of a circle is a point in the x-y plane. Design the class Circle that can store the radius and center of the circle. Here is my code so far

package circle;

public class Circle {

public static void main(String args[]) {

Circle circle = new Circle(2,3,5);

System.out.println(circle);

//Represents center

private int x,y;

//Represents radius

private double radius;

public Circle(int x, int y, double radius) {

this.x = x;

this.y = y;

this.radius = radius;

}

public int getX() {

return x;

}

public void setX(int x) {

this.x = x;

}

public int getY() {

return y;

}

public void setY(int y) {

this.y = y;

}

public double getRadius() {

return radius;

}

public void setRadius(double radius) {

this.radius = radius;

}

}

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

Professional IPhone And IPad Database Application Programming

Authors: Patrick Alessi

1st Edition

0470636173, 978-0470636176

More Books

Students also viewed these Databases questions

Question

Workforce Planning and Predictive Workforce Monitoring? P-697

Answered: 1 week ago

Question

Consider the input output pairs , , , Answered: 1 week ago

Answered: 1 week ago

Question

1. Describe the factors that lead to productive conflict

Answered: 1 week ago