epresenting a point in the plane, a class named PlanePoint has • Two data members i.e. X and Y (correspond to x and y coordinates) of integer type, • Two accessor functions named as getX() and getY() to get values of data members X and Y • A function named planeDistance() that calculates and returns the distance between two points in a plane Derive a class named SpacePoint to imagine a point in a three-dimensional space and has following additional features: • A data member Z of type integer to represent the z-coordinate of a point in space • A no-argument constructor that constructs a point with coordinates (0,0,0) • A constructor with three arguments that constructs a point with three specified coordinate values • An accessor function, which returns the value of data field Z • A function named spaceDistance to return the distance between two points in the space Implement both the classes and in the main() create two points with different dimensions and invoke appropriate function to display the distance between these two points

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 3PE: Chapter 10 defined the class circleType to implement the basic properties of a circle. (Add the...
icon
Related questions
Question

Representing a point in the plane, a class named PlanePoint has
• Two data members i.e. X and Y (correspond to x and y coordinates) of integer type,
• Two accessor functions named as getX() and getY() to get values of data members X and
Y
• A function named planeDistance() that calculates and returns the distance between two
points in a plane
Derive a class named SpacePoint to imagine a point in a three-dimensional space and has
following additional features:
• A data member Z of type integer to represent the z-coordinate of a point in space
• A no-argument constructor that constructs a point with coordinates (0,0,0)
• A constructor with three arguments that constructs a point with three specified coordinate
values
• An accessor function, which returns the value of data field Z
• A function named spaceDistance to return the distance between two points in the space
Implement both the classes and in the main() create two points with different dimensions and
invoke appropriate function to display the distance between these two points.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Data members
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning