can somebody solve this question if was using c++ studio..
Create an advance data type to represent a Complex Number. A complex number is something which has two parts,
the real part and an imaginary part. Some example complex numbers are:
2+3i, -5+7i, -1-2i, and so on. Name this class "Complex". This class should have only two member variables:
1) real (int type)
2) imaginary (int type)
Make all the member variables private. For this class, implement the following:
1) Constructors (default and overloaded), Getters and Setters.
2) overload the following operators as friend functions: ==, +, binary -, unary -, <<, >>
3) Friend function named Multiply which can multiply two complex numbers and return the result complex number
4) Member function named Multiply which can multiply two complex numbers and return the result complex number
5) Non-friend Non-member function named NonMemberMultiply which can multiply two complex numbers and return the result
complex number.
Note the following points:
1) the overloaded operator "<<" should print the complex number in the form like this: 2+3i, or -2+4i
2) also note that, if a complex number has real part 0, then it should be printed like this: 4i. Similarly if it has imaginary part 0, it should be printed just like an integer like this: -2.
3) Your code must be Efficient (call-by-reference) and Secure (const) as much as possible.
4) note that multiplying two complex numbers, for example 2-3i and -4+5i works like this:
(2-3i) * (-4+5i) = 2*(-4+5i) -3i*(-4+5i)
= -8+10i + 12i -15(I*i)
= -8+10i + 12i -15(-1)
= -8+10i + 12i +15
= 7+22i