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 : Operator Overloading
Using APPENDIX A as starting points, solve the following two exercises:
Implement a class for arithmetic using imaginary numbers 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
b A constructor with two arguments a and sets the real part to parameter
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 rightside object to the left side object, eg
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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
