Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can you please tell me why the output is not correct, and why the previous line write double pointsDistance = 0.0 You may declare
Can you please tell me why the output is not correct, and why the previous line write " double pointsDistance = 0.0"
You may declare additional variables Ex: For points (1.0,2.0) and (1. 50), pointsDistance is 3.0 1 import java.util.Scanner; 2 3 public class CoordinateGeometry 4 public static void main (Stri s [] args) ( double x11.0; double y1 2.0; double x2 1.0; double y2 = 5.0; 9double pointsDistance e.e; 6 10 double | pointDistance - Math.sqrt (Math. pow(x2-x1,2.0) + Math. pow(y2-y1,2.0)); System.out.print("Points distance:") System.out.println(pointsDistance); 12 13 14 Run Testing with (1.0, 2.0) and (1.0, 5.0) Output differs. See highlights below. Your output Expected output 3 Type here to searchStep 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