Computers and Technology

In Programming Exercise 9.4, the MyPoint class was created to model a point in a two-dimensional space. The MyPoint class has the properties x and y that represent x- and y-coordinates, two get functions for x and y, and the function for returning the distance between two points. Create a class named ThreeDPoint to model a point in a three-dimensional space. Let ThreeDPoint be derived from MyPoint with the following additional features: A data field named z that represents the z-coordinate.
A no-arg constructor that constructs a point with coordinates (0, 0, 0).
A constructor that constructs a point with three specified coordinates.
A constant get function that returns the z value.
A constant distance (const MyPoint&) function to return the distance between this point and the other point in the three-dimensional space.
Draw the UML diagram for the classes involved. Implement the classes. Write a test program that creates two points (0, 0, 0) and (10, 30, 25.5) and displays the distance between them.

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 11:30, KrishnaBalaram1235
To hide gridline when you display or print a worksheet
Answers: 1
image
Computers and Technology, 24.06.2019 06:50, emmv565628
What are the things you are considering before uploading photos on social media?
Answers: 1
image
Computers and Technology, 24.06.2019 07:30, Isabellawuzhere
Aproject involves many computing systems working together on disjointed task towards a single goal what form of computing would the project be using
Answers: 3
image
Computers and Technology, 25.06.2019 01:30, babyquinnz
Why is the most liked picture on instagram an eggy? owo
Answers: 1
Do you know the correct answer?
In Programming Exercise 9.4, the MyPoint class was created to model a point in a two-dimensional spa...

Questions in other subjects:

Konu
Physics, 25.10.2019 20:43