Write a definition of a class named Point that might be used to store and manipulate the location of a point in the plane. You will need to declare and implement the following member functions: a. A member function set that sets the private data after an object of this class is created. b. A member function to move the point by an amount along the vertical and horizontal directions specified by the first and second arguments. c. A member function to rotate the point by 90 degrees clockwise around the origin. d. Two const inspector functions to retrieve the current coordinates of the point.Document these functions with appropriate comments. Embed your class in a test program that requests data for several points from the user, creates the points, then exercises the member functions.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
Write a definition of a class named Point that might be used to store and manipulate the location of a point in the plane. You will need to declare and implement the following member functions:
a. A member function set that sets the private data after an object of this class is created.
b. A member function to move the point by an amount along the vertical and horizontal directions specified by the first and second arguments.
c. A member function to rotate the point by 90 degrees clockwise around the origin.
d. Two const inspector functions to retrieve the current coordinates of the point.Document these functions with appropriate comments. Embed your class in a test program that requests data for several points from the user, creates the points, then exercises the member functions.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps