Complex number class
Design a class in C++, Java, and Python that represents complex numbers and supports important operations such as addition, subtraction, multiplication and division. For the C++ and Python versions you will need to implement the following functions for each operation:
Where op is one of +, -, *, or /. In addition, you will need to overload the stream insertion operator
A constructor must be defined. Any other methods you deem appropriate should also be included. The more complete your class the better.
The Java version will not have as many methods because Java does not allow for operator overloading or friend functions. Again, the more complete your Java class the better. Override the toString() method.
The Python version you should also include functions for converting from complexes to strings.
The required files for this project are: a main.cc that instantiates complex numbers and tests all methods and functions and a Main.java file that instantiates and tests all methods of the Complex class. The python files required are a main.py file.
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here