Question: Please help with this: Download files cplx . cpp , cplx . h , and lab 4 ExA.cpp from the D 2 L and draw

Please help with this:
Download files cplx
.
cpp
,
cplx
.
h
,
and lab
4
ExA.cpp from the D
2
L and draw AR diagrams for: point
one and point two.
For this exercise you just need to draw the diagrams. However, if you want to compile and run it from
command line, you should have all of the given files in the same directory and from that directory you should
use the following command to compile and create an executable:
g
+
+
-
Wall cplx
.
cpp lab
4
ExA.cpp
Please notice that you shouldn
t have the header file name
(
s
)
in this command.
What to Submit:
Submit your diagram as part of your lab report
cplx
.
cpp:
#include
"
cplx
.
h
"
Cplx::Cplx
(
double real
,
double imag
)
: realM
(
real
)
,
imagM
(
imag
)
{
/
/
point one
}
double Cplx::getRealPart
(
)
const
{
return realM;
}
double Cplx::getImaginaryPart
(
)
const
{
return imagM;
}
void Cplx::setRealPart
(
double arg
)
{
realM
=
arg;
}
void Cplx::setImaginaryPart
(
double arg
)
{
imagM
=
arg;
/
/
point two
}
cplx
.
h:
#ifndef cplx
_
h
#define cplx
_
h
class Cplx
{
public:
Cplx
(
)
: realM
(
-
9
9
)
,
imagM
(
-
9
9
)
{
}
Cplx
(
double r
,
double i
)
;
double getRealPart
(
)
const;
double getImaginaryPart
(
)
const;
void setRealPart
(
double arg
)
;
void setImaginaryPart
(
double arg
)
;
Cplx add
(
const Cplx& other
)
const;
Cplx subtract
(
const Cplx
*
other
)
const;
private:
double realM;
double imagM;
}
;
#endif
/
*
cplx
_
h
*
/
ExA:
#include
"
cplx
.
h
"
void global
_
print
(
const Cplx& n
)
;
int main
(
void
)
{
Cplx num
1
;
num
1
.
setRealPart
(
6
6
6
)
;
Cplx num
2
(
3
4
,
5
)
;
num
1
.
setImaginaryPart
(
5
0
0
)
;
return
0
;
}
PLEASE DRAW THE AR DIAGRAM BY HAND AND INCLDUDE ARROWS PLEASE AND POINTERS

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!