Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program to calculate the distance between two points: in 2D space (x,y coordinates) with inputs of (x1,y1), (y1,y2) or in 3D space (x,y,z

Write a program to calculate the distance between two points: in 2D space (x,y coordinates) with inputs of (x1,y1), (y1,y2) or in 3D space (x,y,z coordinates) with inputs of (x1,y1,z1), (y1,y2,z2

( 2) = the square root of (2x-x1)^2 + (y2-y1)^2

Ask a user if it is about 2D or 3D.

Print out the answer rounded up to the 2nd digit after the decimal point.

Print out the answer only integer part in parenthesis

Check your calculation here (https://bit.ly/3wX1cKH)

Sample result

2D(1)or3D(2)? 2

***

The distance between *** and *** : 123.45 (123)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions