Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

this should be written in java 2. Create a class called Euclid which does the following: - A main method that - prompts the user

this should be written in java
image text in transcribed
2. Create a class called Euclid which does the following: - A main method that - prompts the user for 2d distance or 3d distance (int would be fine with 2 or 3 as the option) - Gets the coordinate sets between the two points. The User will input doubles. They will need to enter 4 values for 2D(x,y) and 6 values for 3D(x,y,z). - Calls the "distance" method to calculate the Euclidian distance between the two points - There are two static methods called "distance". (Both must called be called 'distance') - Both methods will return a double which is the distance between the two points - One of the distance methods will have 4 double parameters. The other distance method will have 6 double parameters. The formula for the 2d distance is: (x2x1)2+(y2y1)2 The formula for 3d distance is: d=(x1x0)2+(y1y0)2+(z1z0)2 - This will then return control to the main method which will print out the distance between the two points

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

More Books

Students also viewed these Databases questions

Question

=+j Identify the challenges of training an international workforce.

Answered: 1 week ago