Question: w OperatorOverloading_ComplexNumber (1) [Compatibility Mode] Q Search in Document Home Insert Design Layout References Mailings Review View Times New Ro... 11 A- A- Aa A

 w OperatorOverloading_ComplexNumber (1) [Compatibility Mode] Q Search in Document Home Insert

w OperatorOverloading_ComplexNumber (1) [Compatibility Mode] Q Search in Document Home Insert Design Layout References Mailings Review View Times New Ro... 11 A- A- Aa A SEE AU AaBbCcDdEe AaBbCcDdEe AaBbCD AaBbCcDde AaBb AaBbceDd Ee Paste B I Uabe Xx2 Normal No Spacing Heading 1 Heading 2 Title Subtitle Styles Pane Define a class for complex numbers. A complex number is a number of the form a + b*i where for our purposes, a and b are numbers of type double , and i is a number that represents the quantity V-1. Represent a complex number as two values of type double . Name the member variables real and imaginary. (The variable for the number that is multiplied by i is the one called imaginary.) Call the class Complex. Include a constructor with two parameters of type double that can be used to set the member variables of an object to any values. Include a constructor that has only a single parameter of type double ; call this parameter realPart and define the constructor so that the object will be initialized to realPart+ 0*i. Include a default constructor that initializes an object to 0 (that is, to 0 + 0*i). Overload all the following operators so that they correctly apply to the type Complex : ==,+,-, 1, >>, and > and >, and > and

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!