Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 search

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

Advances In Knowledge Discovery In Databases

Authors: Animesh Adhikari, Jhimli Adhikari

1st Edition

3319132121, 9783319132129

More Books

Students also viewed these Databases questions

Question

In an Excel Pivot Table, how is a Fact/Measure Column repeated?

Answered: 1 week ago