Answered step by step
Verified Expert Solution
Question
1 Approved Answer
rite a C++ program to represent a Complex number using a Class. A file named complexnum.h should be created for the definition of the complex
rite a C++ program to represent a Complex number using a Class. A file named complexnum.h should be created for the definition of the complex number class and the defining of the implementation should be done in the complexnum.cpp file. The following points should be consisted in the program.
- Get the real part and imaginary part values of the complex number form the user and make sure to store them in the relevant and correct data members. Make sure to dynamically allocate memory in the constructor for those data members.
- Make sure to implement the destructor and also implement the relevant member functions.
- Also implement overload operators for complex number addition, subtraction, multiplication and division
- Furthermore, make sure to implement a friend function to return the conjugate of a given complex number.
- Use an appropriate test scenario in the main() function and show that the program is working . At the end of the program you should print how many objects have been created from Complex number class in your test scenario.
- please make sure to include each and every point
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started