I am having trouble wrapping my head around classes. I'm not to sure what they are used for or how to use them. so i need some serious help with this assignment for my class.
This is the assignment:
**Create a class called Coordinate for performing arithmetic with x/y/z coordinates in a system. Test your class with the pa8.cpp program included below.
Coordinates have the form (x, y, z)
Use double variables to represent the private data of the class.
Provide a constructor that enables an object to be initialized when it is declared and has default values of 0.0.
Provide a public member function "add" to add two Coordinates together. Add both of the x, both of the y, and both of the z values and return a new Coordinate.
Provide a public member function "subtract" to subtract two Coordinates together. Subtract both of the x values, both of the y values, and both of the z values and return a new Coordinate.
Provide a public member function "printCoordinate" to print the coordinate in the form "(x, y, z)".
Provie a public member function "setCoordinate" to set the values of x, y and z values of the Coordinate.
The output should look as follows:
(1, 7, 0) + (9, 8, 7) = (10, 15, 7)
(10, 1, 10) - (11, 3, 20) = (-1, -2, -10)
**
i have no idea where to even start. Can someone please help me by expaining the way classes work and give me an idea on what kind of code is needed for this program?