Answered step by step
Verified Expert Solution
Question
1 Approved Answer
ublic static void main(Stringt args) Scanner scannew Scanner (System.in) System.out.println(Enter the coordinates for the rectangular portion , as - : String point inLnextLine().split(- Point[ 0]point[0].substring
ublic static void main(Stringt args) Scanner scannew Scanner (System.in) System.out.println("Enter the coordinates for the rectangular portion , as-: String point inLnextLine().split("-" Point[ 0]point[0].substring (1,point[0].length()-1); Point [1] = point [1] . substring (1,point [1]length ()-1); String P1 Point[0].split("," String P2[]-Point[1].split("," int xl -Integer.parseInt (P1 [01) int yl = Integer.parseInt ( Pl[1]); int x2 Integer.parseInt (P2 0]); int yl Integer.parseInt (p2[1]) int side 1 = x2 - x1; int side2 - yl - y2; ); e Messages jGRASP Messages Run I/O Interactions jGRASP exec: javac-g Asgn2.java Asgn2.java:21: error: class expected String point]- int.nextLine).split("-" Asgn2.java:21: error: expected string point[] = int.nextLine ( ).split("-"); 2 errors
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started