I have a job in C ++, and I am having problems running. The goal is to "create a class that uses the following overloaded operators for complex numbers: β <<+ - * /"
My question is not the syntax of this, but the logic. I could use some brainstorming help.
Input example:
2.5 -2.2
1.0 1.0
OutPut Sample:
A = (2.5) + (-2.2) i
B = (1.0) + (1.0) i
A + B = (3.5) + (-1.2) i
A - B = ..............
A * B = ..............
A / B = ..............
So how do I get started? The Complex class overloads these operators, which means that I can only use these operators in a class (i.e., Inside public functions)? If I wanted to do it like this? Or do I want to do this in my client / driver code?
Secondly, is this just adding me to the second value of each row? It seems too easy. Any direction would be greatly appreciated. (Just for the record, I'm not looking for anyone who could do my homework for me ... could just use some kind of input)
c ++ operator-overloading complex-numbers
Steve's a d
source share