Question: import java.util.*; public class RecMain { public static void main( String[] RecMain ) { Scanner keyboard = new Scanner( System.in ); System.out.print( Enter the two
![import java.util.*; public class RecMain { public static void main( String[]](https://dsd5zvtm8ll6.cloudfront.net/si.experts.images/questions/2024/09/66f4603426234_44366f46033b8e03.jpg)


import java.util.*; public class RecMain { public static void main( String[] RecMain ) { Scanner keyboard = new Scanner( System.in ); System.out.print( "Enter the two corners of rectangle 1: " ); Rectangle r1 = new Rectangle( keyboard.nextDouble(), keyboard.nextDouble(), keyboard.nextDouble(), keyboard.nextDouble() ); System.out.print( "Enter the two corners of rectangle 2: " ); Rectangle r2 = new Rectangle( keyboard.nextDouble(), keyboard.nextDouble(), keyboard.nextDouble(), keyboard.nextDouble() ); boolean f = r1.disjoint( r2 ); System.out.println( ( f ) ? "The rectangles are disjoint." : "The rectangels intersects." ); System.out.print( "Enter x and y: " ); double x = keyboard.nextDouble(); double y = keyboard.nextDouble(); f = r1.isIn( x, y ); System.out.println( ( f ) ? "The point is in No.1." : "The point is not in No.1." ); if ( !f ) { System.out.printf( "Its distance is %f. ", r1.distance( x, y ) ); } f = r2.isIn( x, y ); System.out.println( ( f ) ? "The point is in No.2." : "The point is not in No.2." ); if ( !f ) { System.out.printf( "Its distance is %f. ", r2.distance( x, y ) ); } } }
***please write this in java language! thank you
% Java RecMain Enter the two corners of rectangle 1: 115 5 Enter the two corners of rectangle 2: 10 10 17 16 The rectangles are disjoint. Enter x and y: 2 3 The point is in No.1. The point is not in No.2 Its distance is 10.630146. The coordinates of the corners of each rectangle are decomposed into two ranges, the range of the x-coordinates and the range of the y-coordinates. For example, a rectangle whose upper-left corner is (4,10) and its lower-right corner is (11,-1) is represented by the x-range [4, 11] and the y-range [-1,10]
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
