Question: Coord02 Add constructors to your class named Coord Start with the Coord class from the Coord01B assignment. Make the changes and save the new .cpp
Coord02
Add constructors to your class named Coord
- Start with the Coord class from the Coord01B assignment.
- Make the changes and save the new .cpp file as Coord02.cpp
- Leave the class name in the program as Coord
- Create the following constructors
- Constructor that takes 3 ints to represent the xCoord, yCoord, zCoord
- Constructor that takes no parameters, assigns 0 to the xCoord, yCoord, and zCoord
Do not forget the test plan
/************************************************** * * program name: Coord * Author: * date due: 10/28/20 * remarks: * * ***************************************************/ /****************************************** * library includes ******************************************/ #include // needed for cin and cout /****************************************** * pre-processor ******************************************/ #define PI 3.14159 using namespace std; class Coord { private: int xCoord; int yCoord; int zCoord; public: void setXCoord(int x) {xCoord = x;} void setYCoord(int x) {yCoord = x;} void setZCoord(int x) {zCoord = x;} int getXCoord() {return xCoord; } int getYCoord() {return yCoord; } int getZCoord() {return zCoord; } void display() { cout<<' '; cout<<"xCoord is"<<'\t'<
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
