Answered step by step
Verified Expert Solution
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
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
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