![Database System Concepts](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
Part 1 is already done and here it is
public class Point {
protected double x;
protected double y;
public Point() {
}
public Point(double x, double y) {
this.x = x;
this.y = y;
}
public double getX() {
return x;
}
public double getY() {
return y;
}
public void setPoint(Point X){
x = X.x;
y = X.y;
}
void makeCopy(Point x){
setPoint(x);
}
Point getCopy(){
return this;
}
public void printPoint(){
System.out.println("["+this.x+", "+this.y+"]");
}
@Override
public String toString() {
return "x-Coordinate is " + x + "and y-coordinate is " + y;
}
public boolean equals(Point X) {
if (this.x != X.x)
return false;
if(this.y != X.y)
return false;
return true;
}
}
public class TestPoint {
public static void main(String[] args){
Point myPoint = new Point(5,4);
Point yourPoint = new Point(0,0);
myPoint.printPoint();
yourPoint.printPoint();
yourPoint.setPoint(new Point(5,45));
System.out.println(myPoint.equals(yourPoint));
myPoint.setPoint(new Point(6,9));
myPoint.printPoint();
yourPoint.makeCopy(myPoint);
yourPoint.printPoint();
}
NEED part 2
![2. Every circle has a center and a radius.
- Given the radius, we can determine the circle's area and circumference.
- Given the center, we can determine its position ini the x-y plane. The
center of a circle is a póint in the x-y plane.
- Design the class Circle that can store the radius and center of the
circle. Since the center is a point in the x-y plane , we can use the Point
class that we already designed in #1, we must derive the class Circle from
the class Point. We should be able to perform the usual operations on a
circle, such as setting the radius, printing the radius, calculating and printing
the area and circumference, and carrying out the usual operations on the
center.
The class Circle should contain the folowing methods and data member:
12. protected member radius
13. default constructor
14. constructor with parameters
15. setCircle(x)
16. getRadius(')
17. setRadius(x )
18. toString( )
19. equals(x)
20. makeCopy(x)
21. getCopy(')
22. printCircle( )
23. area( ) -x • r2
24. circumference( ) - 2 • z • radius](https://content.bartleby.com/qna-images/question/b64c1c6f-d4d7-4d8b-8ebe-5eadb49feddc/e353b20a-f728-468d-9270-6810b663f2c5/sajo5xi_thumbnail.png)
![The output should show the following:
Initialize myCircle to (5.00, 4.00, 7.23)
Initialize yourCircle to (Õ.00, 0.00,0.00)
Set yourCircle to (5.00, 45.00, 82.20)
Determine the area of yourCircle: ???
Determine the circumference of yourCircle: ???
- Determine if the 2 circles are equal or not
- Enter the center as (6.50, 8.75)
Enter the radius as 13.0
Set myCircle with (6.50, 8.75, 13.00)
Copy myCircle into yourCircle and then print yourCircle.](https://content.bartleby.com/qna-images/question/b64c1c6f-d4d7-4d8b-8ebe-5eadb49feddc/e353b20a-f728-468d-9270-6810b663f2c5/kipdjx9_thumbnail.png)
![Check Mark](/static/check-mark.png)
Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 5 images
![Blurred answer](/static/blurred-answer.jpg)
- public class Course { private String courseNumber, courseTitle; public Course() { } public Course(String courseNumber, String courseTitle) { this.courseNumber = courseNumber; this.courseTitle = courseTitle; } public void setCourseNumber(String courseNumber) { this.courseNumber = courseNumber; } public void setCourseTitle(String courseTitle) { this.courseTitle = courseTitle; } public String getCourseNumber() { return courseNumber; } public String getCourseTitle() { return courseTitle; } public void printInfo() { System.out.println("Course Information: "); System.out.println(" Course Number: " + courseNumber); System.out.println(" Course Title: " +…arrow_forwardConsider the following class definitions: public class Thing {public void string_method(String word) {word = word.substring(word.length() - 1);System.out.print(word);} }public class Thing2 extends Thing {public void string_method(String word) {super.string_method(word);System.out.print(word.substring(0,1));}} The following code segment appears in a class other than Thing or Thing2 Thing2 thing = new Thing2();thing.string_method("Tacky"); What is printed as a result of running the code segment? Group of answer choices yT yy Index Out of Bounds Error TT TackyTackyarrow_forwardpublic class Ex08FanTest { public static void main (String[] args){ Ex08Fan fan1= new Ex08Fan(); Ex08Fan fan2= new Ex08Fan(); fan1.setOn(true); fan1.setSpeed(3); fan1.setRadius(10); fan1.setColor("yellow"); fan2.setOn(true); fan2.setSpeed(2); fan2.setRadius(5); fan2.setColor("blue"); fan2.setOn(false); System.out.println("Fan 1:\n" + fan1.toString()); System.out.println("\nFan 2:\n" + fan2.toString()); }}arrow_forward
- Java programarrow_forwardGiven the following class definition: class Point2d { private int x, y; public Point2d () { X = 0; y = 0; } public Point2d (int i, int j) { X = i; y = j; } public void SetX (int i) { x = i; } public void SetY (int j) { y = j; } public int GetX () { return x; public int GetŸ () { return y; } public String toString() { return '[' + x + ", } + y + ']'; } } Use inheritance to create a class, Point3d, with any additional appropriate data and/or functions.arrow_forwardPLEASE ANSWER ALL QUESTIONS ON THE NEXT PAGE: class bookType { public: void setBookTitle(string s); //sets the bookTitle to s void setBookISBN(string ISBN); //sets the private member bookISBN to the parameter void setBookPrice(double cost); //sets the private member bookPrice to cost void setCopiesInStock(int noOfCopies); //sets the private member copiesInStock to noOfCopies void printInfo() const; //prints the bookTitle, bookISBN, the bookPrice and the copiesInStock string getBookISBN() const; //returns the bookISBN double getBookPrice() const; //returns the bookPrice int showQuantityInStock() const; //returns the quantity in stock void updateQuantity(int addBooks); //adds addBooks to the quantityInStock, so that the quantity in stock now has it original // value plus the parameter sent to this function private: string…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
![Text book image](https://www.bartleby.com/isbn_cover_images/9780078022159/9780078022159_smallCoverImage.jpg)
![Text book image](https://www.bartleby.com/isbn_cover_images/9780134444321/9780134444321_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9780132737968/9780132737968_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9780133976892/9780133976892_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9781337627900/9781337627900_smallCoverImage.gif)
![Text book image](https://www.bartleby.com/isbn_cover_images/9780073373843/9780073373843_smallCoverImage.gif)