Please use C++ and include the main.cpp, .cpp, and .h file. Thank you!


Hint – For main function, you can use the following:
int main() {
// User input a Complex Number:
double real, imag;
cout << "Enter the Complex Number (a + bi format, separated by spaces): ";
cin >> real >> imag;
Complex input_f0 = Complex(real,imag);
int n;
cout<<"Enter n: ";
cin>> n;
cout<< ComplexSequence(input_f0,n)<<endl;
int m;
cout<<"Enter size of Complex vector m: ";
cin>> m;
// User input for the first complex vector
cout << "Enter the elements of the first complex vector (a + bi format, separated by spaces)
vector<Complex> inputElements1;
for (int i = 0; i < m; i++) {
double real, imag;
cin >> real >> imag;
inputElements1.push_back(Complex(real, imag));
}
ComplexVector v1(inputElements1);
// User input for the second complex vector
cout << "Enter the elements of the second complex vector (a + bi format, separated by spaces
vector<Complex> inputElements2;
for (int i = 0; i < m; i++) {
double real, imag;
cin >> real >> imag;
inputElements2.push_back(Complex(real, imag));
}
ComplexVector v2(inputElements2);
cout << "v1 + v2 = " << v1 + v2 << endl;
cout << "v1 - v2 = " << v1 - v2 << endl;
cout << "v1 * v2 = " << v1 * v2 << endl;
cout << "v1 / v2 = " << v1 / v2 << endl;
return 0;
}

Problem : Design the ComplexVector class. Design your own ComplexVector class for vectors whose elements are complex numbers. Provide an implementation for - term by term addition - term by term subtraction, - term by term multiplication - term by term division - the stream output operator. Such that if v1 and v2 are ComplexVector objects, then one can compute v1 + v2, etc. Hint : you may want to create a Complex class separately. Complex numbers are expressed in the form a+bi, where a is the real part, b is the imaginary part, and i is the imaginary unit satisfying i2=?1. Print your complex numbers using this representation. When adding (or subtracting) two complex numbers, add (or subtract) their real parts and imaginary parts separately. The multiplication of two complex numbers is defined by, (a+bi)(c+di)=(ac?bd)+(bc+ad)i while division is given by, c+dia+bi?=c2+d2ac+bd?+c2+d2bc?ad?i. Instructions After declaring and defining the ComplexVector class and its member functions, do the following: 1. Using your newly defined ComplexVector class, write a recursive function to print the n-th term in the sequence from equation [3): fn+1?f1??=7+5n2i(2+3i)n?fn?,=( userinput )? 2. Using the vectors v1 and v2 of size m, write a main function that checks v1+v2,v1?v2, v1 * v2, and v1 / v2 by printing them to the console. Compile your code and run your program to check for compile-time errors and logic errors. Submit your header files and source codes to Gradescope in separate files. Figure 1 shows the sample outputs.
Enter the Complex Number ( a+bi format, separated by spaces): 11 Enter n: 2 0.243243+0.540541i Enter size of Complex vector m:2 Enter the elements of the first complex vector (a+bi format, separated by spaces): 1122 Enter the elements of the second complex vector (a+bi format, separated by spaces): 3311 v1+v2=4+4i3+3i v1?v2=?2+?2i1+1i v1?v2=0+6i?+4i v1 / v2 =0.333333+?i2+?i Program ended with exit code: ? Figure 1: Sample output.
For the stream output operator, consider following for the Complex Class friend std::ostream\& operator <<( std::ostream\& os, const Complex\& complex) \{ os ? complex.real ?"+"? complex.imag ?"i"; return os; \} For the ComplexVector: friend std::ostream\& operator << (std::ostream\& os, const ComplexVector\& vector) \{ for (const Complex\& complex : vector.elements) \{ os ? complex ? " "; \} return os; \}