through constructors. Calculate cSum =cl+ c2 and cCon= conjugate of cSum

Advanced Engineering Mathematics
10th Edition
ISBN:9780470458365
Author:Erwin Kreyszig
Publisher:Erwin Kreyszig
Chapter2: Second-order Linear Odes
Section: Chapter Questions
Problem 1RQ
icon
Related questions
Question
Imaginary axis
Questions 2)
C=r+w]
A complex number is defined as
c=r +wJ
and shown in the real-complex plane
as in Figure. Here r is the real part
and the w is the imaginary part.
real axis
The following operations are defined on a complex number. Let ci berntwij and cz be
rz+wa].
• (+) Addition : ci + c → (ri +r2 )+ (wi+ wz) j
• ) Assign : a = c2 > ri= r2; wi = w2
(*) Multiplication: c1 * c2 > (rı + wij ) * (r2 + wzj )
= (ri* r2+ n* wzj + wij * r2 + wij * wzj ). Here j= -
1
1. Write a class which represents a complex number c. Real and imaginary pars are
stored as protected members in the class. Real and imaginary parts can also to be
given as real parameters on construction of the class instant. Usual set/get methods are
to be provided to access real and imaginary parts.
2. Implement operators (+), (=) and (*) as described above.
3. Complex Conjugate of C is defined as ī =r- wj. Write a conjugate method which
returs conjugate of number
4. In a main source file construct el = 5 +3j, c2 = 2 + 4j, cSum = 0+0j and cCon=0+0j
through constructors. Calculate
cSum =cl+ c2 and
cCon = conjugate ofcSum
Not: please use one header (h) and one source (cpp) file for the class.
Transcribed Image Text:Imaginary axis Questions 2) C=r+w] A complex number is defined as c=r +wJ and shown in the real-complex plane as in Figure. Here r is the real part and the w is the imaginary part. real axis The following operations are defined on a complex number. Let ci berntwij and cz be rz+wa]. • (+) Addition : ci + c → (ri +r2 )+ (wi+ wz) j • ) Assign : a = c2 > ri= r2; wi = w2 (*) Multiplication: c1 * c2 > (rı + wij ) * (r2 + wzj ) = (ri* r2+ n* wzj + wij * r2 + wij * wzj ). Here j= - 1 1. Write a class which represents a complex number c. Real and imaginary pars are stored as protected members in the class. Real and imaginary parts can also to be given as real parameters on construction of the class instant. Usual set/get methods are to be provided to access real and imaginary parts. 2. Implement operators (+), (=) and (*) as described above. 3. Complex Conjugate of C is defined as ī =r- wj. Write a conjugate method which returs conjugate of number 4. In a main source file construct el = 5 +3j, c2 = 2 + 4j, cSum = 0+0j and cCon=0+0j through constructors. Calculate cSum =cl+ c2 and cCon = conjugate ofcSum Not: please use one header (h) and one source (cpp) file for the class.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Binomial Expansion
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, advanced-math and related others by exploring similar questions and additional content below.
Recommended textbooks for you
Advanced Engineering Mathematics
Advanced Engineering Mathematics
Advanced Math
ISBN:
9780470458365
Author:
Erwin Kreyszig
Publisher:
Wiley, John & Sons, Incorporated
Numerical Methods for Engineers
Numerical Methods for Engineers
Advanced Math
ISBN:
9780073397924
Author:
Steven C. Chapra Dr., Raymond P. Canale
Publisher:
McGraw-Hill Education
Introductory Mathematics for Engineering Applicat…
Introductory Mathematics for Engineering Applicat…
Advanced Math
ISBN:
9781118141809
Author:
Nathan Klingbeil
Publisher:
WILEY
Mathematics For Machine Technology
Mathematics For Machine Technology
Advanced Math
ISBN:
9781337798310
Author:
Peterson, John.
Publisher:
Cengage Learning,
Basic Technical Mathematics
Basic Technical Mathematics
Advanced Math
ISBN:
9780134437705
Author:
Washington
Publisher:
PEARSON
Topology
Topology
Advanced Math
ISBN:
9780134689517
Author:
Munkres, James R.
Publisher:
Pearson,