Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use java. 2. Write a program that prompts the user to enter three 3-dimensional points. Create a class MyPoint to store the values provided

image text in transcribed

Please use java.

2. Write a program that prompts the user to enter three 3-dimensional points. Create a class MyPoint to store the values provided by the user, the point class must have the following methods a. My Point (double x, double y, double z) b. void toString() Returns a string in the format" (x, y, z)" c. double distance (My point otherPoint) Returns the distance from this point to the otherPoint d. MyPoint getCenterPoint(MyPoint otherPoint) Returns the midpoint between this point and the otherPoint Enter point A: 2 2 5 Enter point B: 6 4 8 Enter point C: 12 0 -12 Distance from A to B : 5.385165 Distance from A to C: 19.824228 Distance from B to C: 21.260292 Midpoint of A and B: (4, 3, 6.5) Midpoint of A and c: (7, 1, -6.5) Midpoint of B and c: (9, 2, -2)

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

What is meant by planning or define planning?

Answered: 1 week ago

Question

Define span of management or define span of control ?

Answered: 1 week ago

Question

What is meant by formal organisation ?

Answered: 1 week ago

Question

What is meant by staff authority ?

Answered: 1 week ago

Question

1. Describe the factors that lead to productive conflict

Answered: 1 week ago