Problem
Model a C ++ class that manages a collection of complex numbers defined by the attributes: length of type int, a pointer of numeric type (int, float, double) for an array with the real part of the complex numbers and a similar one for the imaginary part.
The class will contain a constructor no parameter that will define length with a globally defined constant value = 10, allocating space for the two real / image arrays to this dimension, a constructor with an int parameter that defines length with this value and allocate the space related to the two arrays, and a copy constructor.
The class will contain set / get methods for length, a set type method for the two arrays type attributes of the current object that will have as parameters the addresses of two arrays in which the real / imaginary parts of the complex collection type number will be taken beforehand, and a method for displaying the real and imaginary part of a class object using the class attributes of the class.
The
The class will contain a constructor no parameter that will define length with a globally defined constant value = 10, allocating space for the two real / image arrays to this dimension, a constructor with an int parameter that defines length with this value and allocate the space related to the two arrays, and a copy constructor.
The class will contain set / get methods for length, a set type method for the two arrays type attributes of the current object that will have as parameters the addresses of two arrays in which the real / imaginary parts of the complex collection type number will be taken beforehand, and a method for displaying the real and imaginary part of a class object using the class attributes of the class.
The