subject

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.

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 23:30
What is the digital revolution and how did it change society? what are the benefits of digital media?
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
You are consulting for a beverage distributor who is interested in determining the benefits it could achieve from implementing new information systems. what will you advise as the first step?
Answers: 1
question
Computers and Technology, 23.06.2019 22:20
What is a programming method that provides for interactive modules to a website?
Answers: 1
question
Computers and Technology, 24.06.2019 02:10
Consider the usual algorithm to convert an infix expression to a postfix expression. suppose that you have read 10 input characters during a conversion and that the stack now contains these symbols: (5 points) | | | + | | ( | bottom |_*_| now, suppose that you read and process the 11th symbol of the input. draw the stack for the case where the 11th symbol is
Answers: 2
You know the right answer?
In Programming Exercise 9.4, the MyPoint class was created to model a point in a two-dimensional spa...
Questions
question
Chemistry, 26.08.2019 21:30
question
Mathematics, 26.08.2019 21:30