Answered step by step
Verified Expert Solution
Question
1 Approved Answer
1. A complex number is of the form a +ib. Let x = a +ib and y = c+id. The operation of adding two complex
1. A complex number is of the form a +ib. Let x = a +ib and y = c+id. The operation of adding two complex numbers is: x+y = (a + c)+i(b + d). The operation of subtracting two complex number is: x - y = (a - c)+i(b-d). The operation of multiplying two complex number is: xxy = (ac - bd) +i(bc + ad). The operation of dividing two complex number is: (ac+bd) bc-ad y c + d Write a class called Complex for adding, subtracting, multiplying, and dividing two complex numbers. These member functions shall take one complex number (NOT two complex numbers) and return the result via the return type. The class shall have a single complex number as its data member. Include one or more constructors as appropriate. Also include the set, get, and display member functions. Use a header file called Complex.h, an implementation file called Complex.cpp, and an application file called Application.cpp. Test the Complex class in the main function. c + Use pass-by-reference to eliminate the overhead of copying the argument to the parameter for the four math functions. If a member function will not modify the data member, make the function constant so that data members will not be accidentally modified in the function body. If a parameter is pass-by-reference and the function will not modify the parameter, use constant data to ensure that the corresponding argument will not be accidentally modified in the function body
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