HELP WITH THIS UML

hello i have this UML diagram to make a class that will handle complex numbers, but i dont know how to actually , implement this on a header file,
i understand this type of line +getComplex(double&, double&) const: void, thats a void function , but the rest of the UML is very confusing. Can someone please, tell me how to lets call it , translate this UML to a class type{};
thanks.

complexType

-realPart, imaginaryPart: double
+complexType (double=0.0, double=0.0):

+<<friend>> operator << (ostream&, const complexType&):ostream&
+<<friend>> operator >> (istream&, complexType&):istream&

+operator + (const complexType&): complexType
+operator - (const complexType&): complexType
+operator * (const complexType&): complexType
+operator / (const complexType&): complexType

+operator == (const complexType&): bool
+operator != (const complexType&): bool

+setComplex(const double&, const double&): void
+getComplex(double&, double&) const: void
+abs() const: double
Last edited on
To give you an idea:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
class complexType // <---
{ // <---
double realPart, imaginaryPart // <---
+complexType (double=0.0, double=0.0):

friend ostream& operator << (ostream& os, const complexType&) // <---
{
...
  return os;
}
+<<friend>> operator >> (istream&, complexType&):istream&

complexType operator + (const complexType& ct) // <---
{
  complexType  result(realPart, imaginaryPart);
... // Do the add operation with result and ct
  return result;
}
+operator - (const complexType&): complexType
+operator * (const complexType&): complexType
+operator / (const complexType&): complexType

+operator == (const complexType&): bool
+operator != (const complexType&): bool

+setComplex(const double&, const double&): void
void getComplex(double& r, double& i) const // <---
{
  r = realPart;
  i = imaginaryPart;
}
+abs() const: double
Thanks!!!!! , that actually helps
Topic archived. No new replies allowed.