Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSCI 1301 Lab #11 More on Object Oriented Programming & UML Finding the distance between the centers of two circles Based on the following class:

image text in transcribed
image text in transcribed
CSCI 1301 Lab #11 More on Object Oriented Programming & UML Finding the distance between the centers of two circles Based on the following class: public class Circle f Il The radius of this cirele, and the x & y coordinates of the circle center private double radius, centerX, centerY /Construct a circle object public Circle(double radius, double centerX, double center ) t this.radius radius this.centerX -centerX: this.centerY centerY; /Construct a circle object publie CircleO this (1.0, 1.0, 1.0) /l get and set methods for the private data fields radius, centerX, centerY l an instance distance method Complete the Circle class by adding three sets of get and set methods for the three private data fields. In the Circle class, add another instance method that is passed a reference variable for a current circle. Your distance method should have the following signature line: public double distance(Circle c) The distance formula between any two points (x1,yl) and (x2.y2) is given by Requirements: (1) Draw the UML of the new Circle class; (2) implement the Circle class; (3) in the another program file, implement a test program for a new class named TestCircle with a main method. Save the two program files as Circle java and TestCirele java. In the main method of the TestCircle class, use the Circle constructors to create a first circle object with the default radius (use the no-arg constructor for this) and create a second eircle

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

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

To find integral of sin(logx) .

Answered: 1 week ago

Question

What is Centrifugation?

Answered: 1 week ago

Question

To find integral of ?a 2 - x 2

Answered: 1 week ago

Question

To find integral of e 3x sin4x

Answered: 1 week ago

Question

To find the integral of 3x/(x - 1)(x - 2)(x - 3)

Answered: 1 week ago

Question

6. Explain how to train managers to coach employees.

Answered: 1 week ago