Skip to content

Instantly share code, notes, and snippets.

@fakedrake
Created October 24, 2019 12:19
Show Gist options
  • Save fakedrake/3c265db66fd0f41ec6d08ac973670e74 to your computer and use it in GitHub Desktop.
Save fakedrake/3c265db66fd0f41ec6d08ac973670e74 to your computer and use it in GitHub Desktop.
import java.util.Scanner;
public class Homework {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
System.out.print("Enter x coordinate: ");
int x_coordinate = scan.nextInt();
System.out.print("Enter x coordinate: ");
int y_coordinate = scan.nextInt();
scan.close();
System.out.println("Vector length: "
+ sqrt(pow(x_coordinate,2) + pow(y_coordinate,2)));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment