Question: Write a class to represent a Rectangle. A horizontal rectangle on a grid is uniquely defined by two points. Top left and Bottom right. Write
Write a class to represent a Rectangle. A horizontal rectangle on a grid is uniquely defined by two points. Top left and Bottom right. Write all the other methods for the rectangle class as defined above using UML diagram. Coordinate for each point will be a random integer from 6-8 inclusive. e-RectangleStudent.java RectangleStudent - BR A height BTL A width RectangleStudento RectangleStudent (double, double, double double) Rectanglestudent Point, Point) area double genBRO vold genTLO:void getSRO : Point getTLO. Point heightodouble Inbounds(float, float): boolean overlap (Rectangle): boolean perimeter(): double setan (double, double): void settl (double, double):void toString : String width: double Runner Class: Write a class named Using Rectangles. This is a runner class and has a main method. In this class create 4 rectangle objects a, b, c and d. Then write code to output name of each rectangle which overlaps current rectangle. Check example: Red overlaps: Y and G Green overlaps: Y, R and B Yellow overlaps: R and G Blue overlaps: G Red: R, Green: G, Yellow: Y, Blue: B
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
