In C++ what would be the correct way to write this specificportion or a program? I already have the Test class definitionwritten.
Add the following methods to the Test classdefinition:
- Additional constructor with 2 parameters
- Signature: Test(double realParam, double imaginaryParam)
- Allows a Test object to be created with the specified realvariable (variable name = real) and imaginary variable (variablename = imaginary) parts.
- copy constructor
- Signature: Test(const Test ©Test)
- Copies the data members from copyTest to this object.
Answer
The below is the code for the specified two methods:
//constructor withtwo parameters
Test(double realParam, doubleimagainaryParam)
{
//create a Testobject with specified real and imaginary
OR
OR