Question: Exercise 3: A bounding rectangle is the minimum rectangle that encloses a set of points in a two- dimensional plane, as shown in the figure

 Exercise 3: A bounding rectangle is the minimum rectangle that enclosesa set of points in a two- dimensional plane, as shown in

Exercise 3: A bounding rectangle is the minimum rectangle that encloses a set of points in a two- dimensional plane, as shown in the figure below Write a method that returns a bounding rectangle for a set of points in a two dimensional plane as follows: public static Rectangle getRectangle (double points) //This method finds the xpos, ypos, width and height of the / /bounding rectangle //constructs it and returns it The Rectangle class is the one that you developed in Exercise 1. Use the following test program that prompts the user to enter five points and displays the bounding rectangle's center, width, and height. As you can observe from the code, the x and y coordinates of each point are stored in the 2-d array. For example, if the points are (1.0,2.0), (1.5, 2.0), (3.5, 4.0), (2.5, 1.0), (5.0, 6.0), you would store them in the following 2-d array: 13.5 4.0] 12.5 1.0] [5.0 6.0] The code below can store up to five points, but you can change the array dimensions appropriately //Code for Exercise 3 import java.util.Scanner; public class Exercise3 public static void main(String[ ] args) doublet11] points-new double[5][2]; Scanner input - new Scanner (System.in); System.out.print ( "Enterpoints.length"points:" for (int 0; i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!