Question: 1. Write a class ComplexNumber (declaration and implementation) that has the following private data members: a) an int m real b) an int m imaginary
1. Write a class ComplexNumber (declaration and implementation) that has the following private data members: a) an int m real b) an int m imaginary and the following public member functions: a) A Parametrized ctor that takes 2 int parameters to initialize m_real and m_imaginary to specific values. You are required to use Initializer-list syntax to perform this. You are required to use Initializer-list syntax to perform this. An assignment operator that assigns from another ComplexNumber object to the calling object. An operator+ function that sums 2 complex numbers (resulting ComplexNumber is the sum of real parts and the sum of imaginary parts). c) d) and also uses: e) An insertion operator
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
