Welcome to my blog!

Meet the Author

A club is an association of two or more people united by a common interest or goal. So the ICT club is an association of NIMA’s students , who are interested in Information and Communication Technology .

Looking for something?

Subscribe to this blog!

Receive the latest posts by email. Just enter your email below if you want to subscribe!

Tuesday, May 29, 2018

Operator Overloading: 

when a programmer needs to perform addition, subtraction or any valid operation with one or more objects then operators needed to be redefine.
for example we want to add two objects as

obj1+obj2
then + operator needed to be overloaded or redefine. 
general syntax

Class_Name operator  Symbol 

here operator is a keyword. 
Example of overloading + operator 
#include <iostream>
using namespace std;

class Box {
   public:
      double getVolume(void) {
         return length * breadth * height;
      }
      void setLength( double len ) {
         length = len;
      }
      void setBreadth( double bre ) {
         breadth = bre;
      }
      void setHeight( double hei ) {
         height = hei;
      }
      
      // Overload + operator to add two Box objects.
      Box operator+(const Box& b) {
         Box box;
         box.length = this->length + b.length;
         box.breadth = this->breadth + b.breadth;
         box.height = this->height + b.height;
         return box;
      }
      
   private:
      double length;      // Length of a box
      double breadth;     // Breadth of a box
      double height;      // Height of a box
};

// Main function for the program
int main() {
   Box Box1;                // Declare Box1 of type Box
   Box Box2;                // Declare Box2 of type Box
   Box Box3;                // Declare Box3 of type Box
   double volume = 0.0;     // Store the volume of a box here
 
   // box 1 specification
   Box1.setLength(6.0); 
   Box1.setBreadth(7.0); 
   Box1.setHeight(5.0);
 
   // box 2 specification
   Box2.setLength(12.0); 
   Box2.setBreadth(13.0); 
   Box2.setHeight(10.0);
 
   // volume of box 1
   volume = Box1.getVolume();
   cout << "Volume of Box1 : " << volume <<endl;
 
   // volume of box 2
   volume = Box2.getVolume();
   cout << "Volume of Box2 : " << volume <<endl;

   // Add two object as follows:
   Box3 = Box1 + Box2;

   // volume of box 3
   volume = Box3.getVolume();
   cout << "Volume of Box3 : " << volume <<endl;

   return 0;
}

Thursday, March 12, 2015

The Apple Watch

The Apple Watch 

collection features highly polished stainless steel and space black stainless steel cases. The display is protected by sapphire crystal. And there’s a choice of three different leather bands, a link bracelet, a Milanese loop, and a band made from high-performance fluoroelastomer.

Source: Apple.co




Monday, February 23, 2015

Weclome To ICT Club Blog !

ICT Club Club is association of Student's who are interested in " Information & Communication Technology " . The third event was conducted on '19th Feb' which was about " Creating Web Blog "



As far as this is our first Blog post , Afterward we are going to upload all the staffs and lessons on our Facebook Page and on this blog,

so stay in touch !
Members of  ICT Club with sir Roohul Amin