Posts

Showing posts with the label oop program

OOPs practical codes

 oops practical SE ,AIDS practical practical no :1 /* Implement a class Complex which represents the Complex Number data type. Implement the following 1.  Constructor (including a default constructor which creates the complex number 0+0i). 2.  Overload operator+ to add two complex numbers. 3.  Overload operator* to multiply two complex numbers. 4.  Overload operators << and >> to print and read Complex Numbers */ #include <iostream> using namespace std; class Complex {     double real;     double img; public:     Complex();                                              // Default Constructor     friend istream & operator>>(istream & , Complex & );       // Input     friend ostream & operator<<(ostream & , const Complex & );...