Implement the class Point3D. Put the class definition in the header pl.h and the implementation in the pl.cpp file. You may not have any inline functions defined in the header file. Use the file xercise.cpp to check if your implementation is syntactically correct. • The class has three data members: X, y, and z, which are double. • The default constructor initializes the Point30 to the origin (0, 0, 0), while the working constructor supplies values for X, y, and z: all doubles in that order. • reate accessors getX(), getY() and getZ(). There are no mutators. (The class is inomutable) • Write a member function distance() that retuns the distance between the current Point30 (the implicit parameter which will be the left-hand side of an expression) and a second Point30 passed as an explicit parameter (which will be the right-hand-side of the expression). Here is the distance formula for a 3D point: (X1 -X2 )+ (yı -y2 )'+ (zı -z2 )' You must both define and implement a feature for the tests to run. For instance, if you define getX() but fail to implement it, then yor code will not compile. If your code fails to compile, comment out both the definition and the implementation of the feature that fails.
Implement the class Point3D. Put the class definition in the header pl.h and the implementation in the pl.cpp file. You may not have any inline functions defined in the header file. Use the file xercise.cpp to check if your implementation is syntactically correct. • The class has three data members: X, y, and z, which are double. • The default constructor initializes the Point30 to the origin (0, 0, 0), while the working constructor supplies values for X, y, and z: all doubles in that order. • reate accessors getX(), getY() and getZ(). There are no mutators. (The class is inomutable) • Write a member function distance() that retuns the distance between the current Point30 (the implicit parameter which will be the left-hand side of an expression) and a second Point30 passed as an explicit parameter (which will be the right-hand-side of the expression). Here is the distance formula for a 3D point: (X1 -X2 )+ (yı -y2 )'+ (zı -z2 )' You must both define and implement a feature for the tests to run. For instance, if you define getX() but fail to implement it, then yor code will not compile. If your code fails to compile, comment out both the definition and the implementation of the feature that fails.
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter11: Inheritance And Composition
Section: Chapter Questions
Problem 15PE
Related questions
Question
I'm stuck on this problem
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 1 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning