This repository was archived by the owner on Jan 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcomplexNumber.h
More file actions
49 lines (40 loc) · 1.8 KB
/
Copy pathcomplexNumber.h
File metadata and controls
49 lines (40 loc) · 1.8 KB
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*----------------------------------------------------------------------------+
| Name: Jerome Richards |
| Course: CNS-1250 Section F01 |
| Instructor: Dr. Afsaneh Minaie |
| |
| File: complexNumber.h |
| |
| Purpose: ComplexNumber definition |
+----------------------------------------------------------------------------*/
#ifndef complexNumberH
#define complexNumberH
class ComplexNumber
{
private:
double itsReal;
double itsImag;
public:
// Purpose: Default Constructor
ComplexNumber();
// Purpose: Overloaded Constructor that assigns the real and imaginary
// parts of a complex number
ComplexNumber( double real, double imag );
// Purpose: Add's the passed in complex number to the invoking
// complex number
//
// Parameters: a ComplexNumber object to used during the addition
//
// Returns: a ComplexNumber object that is the sum of the two
ComplexNumber Add( ComplexNumber theCN );
// Purpose: Subtract the passed in complex number from the invoking
// complex number
//
// Parameters: a ComplexNumber object to used during the subtraction
//
// Returns: a ComplexNumber object that is the difference of the two
ComplexNumber Sub( ComplexNumber theCN );
// Purpose: Print the complex number using cout in (real + imag i)
void Print();
};
#endif