Question: code for public class in java FeEdit Selection View Go Run Terminal Help Olej Code DOLORER Circle X OPINGOITORS Hubsstubs > Circlejeva > ts Circle



FeEdit Selection View Go Run Terminal Help Olej Code DOLORER Circle X OPINGOITORS Hubsstubs > Circlejeva > ts Circle X Crew 1 public class Circle extends shape AMA ECO 2 wa 3 private double radius Deduction.java 4 public circle( double x, double y, double radius ) E B 5 //EHSERT YOUR CODE HERE 6 Employee > expected Output.png public double getradius() ( Governmentaja //INSERT YOUR CODE HERE HealthPremium 10 ) Overallax.java 11 Quality Assurance 12 public void setRadius double radius > 13 sales.com //INSERT YOUR CODE HERE 14 TaxCategory ) 15 16 public boolean equals Shape other) 17 //INSERT YOUR CODE HERE ws 18 ) 19 Substutis Cedejave public stringtostring() { Gradetajeve //INSERT YOUR CODE HERE 22 Points 23 Oy Rectangljave 2 V OUTLINE v Orde Clede double double gettadius doute Palesuadublai 1- equalshopel 1.1 @toString Sering in 2 Col2 UTFORU I a 8 v //testing point object public static boolean[] 040 ( boolean () answer = new boolean(s); Point pl - new Point( 2.0, 3.4 ); Point p2 - new Point( 2.0, 3.4 ); answer(0) - pl.equals( p2 ); p1.set( 2,5678 ) pl.setY( 3.98756); answer(1) - Ipi.equals( pa ) answer [2] - pi.getX() - 2.345678 answer") - pi.getY() - 3.98756) answer [4] . pl.tostring().equals("Point (x: 2.345678, y: 3.90756]"); A Qualityssur V JAMA Deduction java Eljava Employee.java expected Output.png Government Taxjave HealthPremium Overallaxjava Quality Assurancej.. salaries.com TaxCategoryjava Tax Testjava Utilityjava stubs subs(3) stubs Circle.java 2 Gradelab java 4 Point.java 6 Quality y Rectanglejova 2 OUTLINE vs Qualityssurance @ 910 bocor 020 :boolean 6 20 stand 6 040 boolean 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 return answer > //testing the circle object public static boolean[] 020) ( boolean () answer = new boolean(5) point pl = new Point( 2.0, 3.4 ); circle ci = new Circle( pi.getX(), pi.getY(), 45.356 ): answer(0) - c1.getLocation().getX() - 2.8; answer[a] - c1.getLocation().getY() - 3.4; answer(2) - d.getRadius() = 45.356; Shape c2 - new Circle( pi.getX(), pi.getY(), 55.356 ) answer() - c1.equals( c2 ); answer(4) - di.tostring().equals("circle [x: 2.0, y: 3.4; radius: 45.356]"); 34 return answer 36 37 38 39 40 41 42 43 44 45 46 //testing the rectangle object public static boolean[03() { boolean (1 answer new boolean(6) 383 ALG SAS un Terminal Help TestShapes java-Java - Visual Studio Code 3 TestShapes.java s(3) > stubs > TestShapesjava > TestShapes 1 public class TestShapes 2 Run Debug public static void main(String[] args) { Paint pi - new Point( 2.0, 3.4 ); Point p2 - new Point( 2.0, 3.4 ); System.out.println("p2 - " + p1 ); System.out.println("p2 . " + p2 ); System.out.println("p1.equals( p2 ) is + p1.equals( p2 ) ); P2 - new Point( 2.5, 3.4 ); 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 Shape ci - new Circle( pi.getX(), pi.getY(), 45:356 ); System.out.println( c ); Shape 1 - new Rectangle( pi.getX(), pi.getY(), 45.35, 28.56 ); System.out.println(ri); System.out.println("p1 + p1 ); System.out.println("p2 + p2); System.out.println("pl.equals( p2 ) is + p1.equals( p2 ) ); System.out.println("a.equals( ru ) is + c1.equals( ri ) ); System.out.println("c1.equals( ci ) is "+c1.equals( c ) ); System.out.println(" "); pl - new Point(2.0, 3.4); Shape 12 - new Rectangle( p1.getX(), pi.getY(), 45.35, 28.56 ); System.out.println("r1 + ri); System.out.println("r2 - +r2); System.out.printin("r1.isLeftof( 2 ) is + ri.isLeftof( 12 ) ); System.out.println("r1.isRightof( r2 ) is " ri.isRightof( r2 ) ); System.out.println("r. isatsamePoints( r2 ) is ri.isAtSamepoints( 12 ) ); Shape isLeftof(Shape): boolean +IsRightOfShape): boolean + isAbove(Shape): boolean + IsBelow(Shape): boolean isAtSamePointAs(Shape): boolean Point X: double y: double equals(Point) : boolean +toString(): String Circle radius: double Rectangle length : double width: double + equals(Shape): boolean .toString(): String + equals(Shape): boolean +toString(): String Figure 2: UML representation of the system under development C:\Users\adesino\Documents\UFV\COMP 155\Labs\Lab 5>java TestShapes p1 - Point [x: 2.e, y: 3.4) p2 - Point [x: 2.0, y: 3.4) pi.equals( p2 ) is true Circle [x: 2.0, y: 3.4; radius: 45.356] Rectangle [x: 2.0, y: 3.4; length: 45.35, width: 28.56] pi - Point (x: 2.0, y: 3.4] P2 - Point (x: 2.5, y: 3.4] pl.equals(p2) is false c1.equals( ri ) is false ci.equals( i ) is true 11 - Rectangle [x: 2.0, y: 3.4; length: 45.35, width: 28.56] r2 - Rectangle [x: 2.e, y: 3.4; length: 45.35, width: 28.56] r1.isLeftof r2 ) is false r1.isRightof ( 12 ) is false ri.isAtSamePointAs( r2 ) is true ri - Rectangle [x: 2.e, y: 3.4; length: 45.35, width: 28.56] F2 - Rectangle (x: 2.5, y: 5.e; length: 45.35, width: 28.56] ri.isLeftof r2 ) is true ri.isRightOf(r2 ) is false r1.isBelow r2 ) is true r2.isAbove ri ) is true test passed. test 1 passed. test 2 passed. test 3 passed. All tests are successful. Total points earned in this lab: 90.2 Figure 3: Output for some runs
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
