Early on in my learning, I created an ultra simple complex number class once with members "real" and "imaginary". This is easy enough, and you can just overload all the operators and add a custom pow() function for the exponent .
I tweaked it to use overloaded operators, am posting the source below. Tell me if I can explain anything, or help you with the rest.
//*************Header File*****************************
//Header file for complex number class
//function definitions found in ComNum.cpp
//prob 6.6 p 449 D & D
#ifndef ComNum_H
#define ComNum_H
#include <iostream>
using std:

stream;
class ComNum
{
friend ostream& operator<<( ostream &, const ComNum & );
public:
ComNum ( double real = 0, double imaginary = 0 );
ComNum operator +( const ComNum & );
private:
double real;
double imaginary;
};
#endif
//****************class function definitions***************
//function definitions for complex number class
//prob 6.6 p 449 D & D
#include "ComNum.h"
ComNum::ComNum( double realPart, double imaginaryPart )
{
real = realPart;
imaginary = imaginaryPart;
}
ComNum ComNum:

perator +( const ComNum &addThis)
{
ComNum temp;
temp.imaginary = imaginary + addThis.imaginary;
temp.real = real + addThis.real;
return temp;
}
ostream& operator<<( ostream &output, const ComNum &x )
{
output << x.real << " + " << x.imaginary << 'i';
return output;
}
//******************driver to test code*******************
//works with ComNum class
//prob 6.6 p 449 D & D
#include <iostream>
using std::cout;
using std::endl;
#include "ComNum.h"
int main()
{
ComNum com1 = ComNum( 5, 10 ),
com2 = ComNum( 3, 1 );
cout << "Complex numbers before calculations: " << '\n'
<< "First: " << com1 << '\n'
<< "Second: " << com2 << '\n' << endl;
cout << "First plus third: " << com1 + com3 << '\n' << endl;
return 0;
}