Implement a Rectangle java class to create the rectangle objects…
Question Answered step-by-step Implement a Rectangle java class to create the rectangle objects… Implement a Rectangle java class to create the rectangle objects and calculate the area of the rectangle objects based on the given UML class diagram. Please just implement the class and the tests in the example table will be executed automatically. ps. rectangle area = width*height For example:TestResultRectangle rec=new Rectangle();System.out.println(rec.getArea());0.0Rectangle rec=new Rectangle(1.2,3.5);System.out.println(rec.getArea());4.2Rectangle rec=new Rectangle(-1.2,3.5);System.out.println(rec.getWidth()+” “+rec.getHeight());1.2 3.5Rectangle rec=new Rectangle();rec.setWidth(3.5);rec.setHeight(-2.5);System.out.println(rec.getArea());8.75Answer:(penalty regime: 0 %) Computer Science Engineering & Technology Java Programming CSIT 111 Share QuestionEmailCopy link Comments (0)


