Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA You will write two java files for this assignment: MyCircle.java, and MyCircle Tester.java The MyCircle.java file is the primary interest. It will create an

JAVA image text in transcribed
image text in transcribed
You will write two java files for this assignment: MyCircle.java, and MyCircle Tester.java The MyCircle.java file is the primary interest. It will create an actual class, the first one that we have written this semester. The MyCircle class is similar to the Rectangle class from the reading The MyCircle class should meet these criteria Three member fields . double radius . double x .double y Eight methods . Six of the methods are simple: getter's and setter's for x, y, and radius . There should also be a getArea method that returns the area (derived from the radius) A doesOverlap method. This method should accept a MyCircle as an argument, and return true if this circle overlaps the circle that the method was invoked on. [Note: two circles overlap if the sum of their radius' is greater than or equal to the distance between their centers.] The reading this week discusses one of the UML diagrams. Here is the diagram for the MyCircle class MyCircle Class double x double y double radius void setx(double value) double getxo void setY(double value) double getYO void setRadius(double value) double getRadius) double getArea0 boolean doesOverlap(MyCircle otherCircle) MyCircleTester Write a second class named MyCircle Tester. It should be in its own file named MyCircle Tester.java. It should contain code that tests your MyCircle class. It should have a static main method, and if you want you can put all of the code inside that main method I encourage you to spend a significant amount of time testing out the MyCircle class. This is a great way to learn the nuances of java syntax. Feel free to write and erase as much code as you want. (Naturally.) After you have tested the code to your own satisfaction, submit code that meets these minimum criteria Allocate and initialize at least thee MyCircle objects Two of them should overlap, and two should not Display the areas of the three circles Invoke doesOverlap on MyCircles to show which circles overlap Submit two files, inside a compressed folder MyCircle.java and MyCircle Tester.java

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

Upgrading Oracle Databases Oracle Database New Features

Authors: Charles Kim, Gary Gordhamer, Sean Scott

1st Edition

B0BL12WFP6, 979-8359657501

More Books

Students also viewed these Databases questions