Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

code in java EXPLORER Point java Rectanglejove X stubs(3) > stubs > Rectangle.java > ts Rectangle public class Rectangle extends Shape 3 private double length,

code in java image text in transcribed
image text in transcribed
EXPLORER Point java Rectanglejove X stubs(3) > stubs > Rectangle.java > ts Rectangle public class Rectangle extends Shape 3 private double length, width: public Rectangle( double x, double y, double length, double width ) ( 5 //INSERT YOUR CODE HERE 2 4 VA public double getLength() { //INSERT YOUR CODE HERE ) > A OPEN EDITORS 1 UNSAVED Point javastus. 1 Rectangle joves 2 JAMA salaries.com TaxCategoryjava Tax Test.java Utilityjava Stubs Stubs(3) stubs Circle.java 2 GradeLab.java Point.java 1 Quality Assur... 9. Rectangle.jew 2 Shape.java 6 TestShapesja. 9. Employee Java Installava.dass Installava Java LabTest.java Math.class Math java MathTestina v OUTLINE ts Rectangle length width Rectangle double, d.. getlength double getWidth double setlength(double). setWidth(double) V- equals(Shape) ... 1 toStringo : String 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 public double getwidth() { //INSERT YOUR CODE HERE } public void settength double length ) { //INSERT YOUR CODE HERE ) public void setuidth( double width ) { // INSERT YOUR CODE HERE } public boolean equals( Share other ) { //INSERT YOUR CODE HERE public String tostring() //INSERT YOUR CODE HERE } 8 A3 boolean () answer = new boolean[5]; Point pi = new Point( 2.0, 3.4 ); Circle ci - new Circle( pi.getX(), pi.getY(), 45.356 ); answer[@] ci.getLocation().getX() == 2.0; answer [1] = cl.getLocation().getY() - 3.4; answer [2] - ci.getRadius() == 45.356; Shape c2 - new Circle( pi.getX(), p1.getY(), 55.356 ); answer [3] Ici.equals( c2 ); answer [4] - c1.toString().equals("circle [x: 2.0, y: 3.4; radius: 45.356]"); return answer; } 4 5 6 7 58 39 10 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 //testing the rectangle object public static boolean[] 03() { boolean [] answer = new boolean[6]; Point i = new Point( 2.0, 3.4 ); Rectangle ri = new Rectangle( pi.getX(), pi.getY(), 45.356, 28.56 ); answer[0] ri.getLocation().getX() -- 2.0; answer(1) ri.getLocation().getY() - 3.4; answer [2] - ri.getLength() 45.356; answer [3] - ri.getWidth() == 28.56; shape r2 = new Rectangle( pi.getX(), pi.getY(), 55.356, 26.57 ); answer [4] - I ri.equals( r2 ); answer(5) - r.toString().equals("Rectangle (x: 2.0, y: 3.4; length: 45.356, width: 28.561"); return answer; } //testing the shape object public static boolean[] 04() {

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_2

Step: 3

blur-text-image_step3

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

More Books

Students also viewed these Databases questions