Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

22 23 /* Your solution goes here 8/ 24 25 System.out.println(pointsDistance); 26 } 27 } CHALLENGE ACTIVITY 2.10.3: Using math functions to calculate the distance

image text in transcribed

22

23 /* Your solution goes here 8/

24

25 System.out.println(pointsDistance);

26 }

27 }

CHALLENGE ACTIVITY 2.10.3: Using math functions to calculate the distance between two points. Determine the distance between point (x1, y1) and point (x2, y2), and assign the result to points Distance. The calculation is: Distance = V(x2 x1)2 + (y2 yl)2 Ex: For points (1.0, 2.0) and (1.0, 5.0), points Distance is 3.0. 1 import java.util.Scanner; 2 3 public class CoordinateGeometry { 4 public static void main(String[] args) { 5 Scanner scnr = new Scanner(System.in); 6 double x1; 7 double y1; 8 double x2; 9 double y2; 19 double points Distance; 11 double xDist; 12 double yDist; 13 14 pointsDistance 0.0; 15 xDist = 0.0 16 yDist = 0.0; 17 18 x1 = scnr.nextDouble(); 19 y1 = scnr.nextDouble(); 20 x2 = scnr.nextDouble(); 21 v2 = scnr.nextDouble()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions