Question: Exercise 4.2: Take your solution to Exercise 4.1 and change it stack that the two data members REAL and IMAG are now both private but

Exercise 4.2: Take your solution to Exercise 4.1 and change it stack that the two data members REAL and IMAG are now both private but leave al the methods as public. Now, since you cant access these valtes directly from the main function anymore you must provide a constructor function that enables an object of this class to be initialised when it is declared. You should also define a default constructor that initialises both values to be set equal to zero. You should also provide two new public member functions to : Reset the values of the real and imaginary values of the Complex number, using the following prototype: void setvalues (double x, double y) You will also need to provide a print function to output a complex number to the screen (c.g. 2+i). The function should have the following prototype: void print) Demonstrate your new constructors, and your two new methods in action in the main function. #include
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
