Question: Task 1 : Operator Overloading Using APPENDIX A as starting points, solve the following two exercises: Implement a class for arithmetic using imaginary numbers (

Task 1: Operator Overloading
Using APPENDIX A as starting points, solve the following two exercises:
Implement a class for arithmetic using imaginary numbers (a+ib). The class has
the following constructors and overloaded operators:
a. A constructor with no arguments sets the real and imaginary parts of the
object to values 0.0.
b. A constructor with two arguments a and b sets the real part to parameter a,
and the imaginary part to parameter b.
c. Operator + adds to imaginary numbers.
d. Operator - subtracts two imaginary numbers.
e. Operator * multiplies two imaginary numbers.
f. Operator displays an imaginary number.
g. Operator reads an imaginary number.
h. Operator = assigns the right-side object to the left side object, e.g.,a=b.
i., Operator == returns true if two imaginary numbers are equal and false
otherwise.
j. Operator != returns true if two imaginary numbers are different and false
otherwise.
The main program should demonstrate the use of all the above constructors and
overloaded operators.
 Task 1: Operator Overloading Using APPENDIX A as starting points, solve

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!