Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!