0

Hey can you help me by correcting the code?

import java.util.scanner; class euclidean distance { public static void main(String[] args) { int x1,x2,y1,y2; system.out.println("enter x,y values of first point"); scanner sc = new scanner(system.in); x1=sc.nextint(); y1=sc.nextint(); system.out.println("enter x,y values of sec point"); scanner sc = new scanner(system.in); x2=sc.nextint(); y2=sc.nextint(); system.out.println("dist is "+ Math.sqrt ((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1))""); } }

26th Aug 2020, 9:59 AM
Pranay Rockzz
Pranay Rockzz - avatar
4 Answers
+ 1
Thank u
26th Aug 2020, 11:12 AM
Pranay Rockzz
Pranay Rockzz - avatar
26th Aug 2020, 10:16 AM
Vadivelan
0
Use Scanner sc=new Scanner(System.in); only once You have not followed to make which letter in uppercase and which letter in lower case. You have not imported math package that is: import java.util.Math; Take input x1,x2,y1,y2 in the same line at once. There are many small mistakes.like:-import.java.util.Scanner; You have not maintained case sensitivity of java.
26th Aug 2020, 10:21 AM
shubham kumar
shubham kumar - avatar
0
First complete a Java Tutorial please. Your code corrected looks i.e. like: https://code.sololearn.com/cQsYmxH6Lx2u/?ref=app
26th Aug 2020, 10:23 AM
JaScript
JaScript - avatar