Tuesday, 11 March 2014

Hybrid Inheritance

In this type of Inheritance more than form of inheritance type occures. It combines two or more form of inheritance .When a sub class inherits from multiple base classes and all of its base classes inherit from a single base class, this form of inheritance can referred as Hybrid inheritance.

First From ::
         __________________
        |  Base class - A  |
        |__________________|
                    ^
                    |
            ________|_________    __________________ 
           |  class - B       |  |  class - C       |
           |__________________|  |__________________|
                    ^                       ^
                    |     __________________|
              ______|____|____
             |  class - D       |
             |__________________|    
General Form ::
    class  A
    {
    };
    class B:public A
    {
    };
    class C
    {
    };
    class  D:public C,public B
    {
    };

For Example :
#include <iostream.h>
#include <conio.h>
class  A
{
  protected:
  int regno;
  public:
  void  getRegno(int a)
  {
    regno=a;
  }
  void  putRegno()
  {
    cout << endl << "Student Registration Number::" << regno;
  }
};
class  B : public  A
{
  protected:
  int Sess_No1,Sess_No2,Sess_No3;
  public:
  void getSessional(int m1,int m2,int m3)
  {
    Sess_No1=m1;
    Sess_No2=m2;
    Sess_No3=m3;
  }
  void  putSessional()
  {
    cout << endl << " Sessinal Marks-1::" << Sess_No1;
    cout << endl << " Sessinal Marks-1::" << Sess_No2;
    cout << endl << " Sessinal Marks-1::" << Sess_No3;
  }
};
class  C
{
  protected :
  char grade;
  public :
  void   getGrade(char i)
  {
     grade=i;
  }
  void  putGrade()
  {
    cout << endl << " Sports  Grade::" << grade;
  }
};
class D : public  C ,public B
{
  private:
  int total;
  public :
  void  dispResult ()
  {
    total=Sess_No1+Sess_No2+Sess_No3;
    putRegno();
    putSessional();
    putGrade();
    cout << endl << "  Total Marks  Obtained::" << total;
  }
};
int main ()
{
  D  object;
  object.getRegno(101);
  object.getSessional(90,90,98);
  object.getGrade('A');
  object.dispResult();
  return 0;
}
Second Form ::
[Need to make virtual base class to handle following form of inheritance]
                   ____________________
          ------->|   Base class - A   |<-------
          |       |____________________|       |
          |                                    |  
          |                                    |
          |                                    |
 _________|__________               ___________|________ 
|  Derive class - B  |             |  Derive class - C  |
|____________________|             |____________________|
          ^                                    ^
          |                                    |  
          |                                    |
          |        ____________________        |
          |_______|  Derive class - D  |_______|
                  |____________________|
                    

General Form ::
    class  A
    {
    };
    class  B:public A
    {
    };
    class  C:public A
    {
    };
    class  D:public  B,public  C
    {
    };

Friday, 13 July 2012


Mag-tech Is a industrious based association, established in Kenya with a view of making medium and long term security across boarders of technology.
Due to an increase in data loss caused by simple and unavoidable accidents such as coffee spill on a laptop at work, mag-tech was established to recover your data in a twinkle of an eye.
Mag-tech is mainly composed of working professionals and a number of students, who were appreciative of the interesting growth of technology and opportunities that the country was presenting, and had a deep desire to contribute their personal skills towards achieving the vision 2030.

We plans to provide security in private homes, public buildings, private/public companies, banks and real estate, and not limiting or confining its territories to the Kenyan boarder.
The association plans to be an umbrella for other security groups by providing guidance, mentorship programs, and other techno-security tools that may be helpful to them.

B. What mag-tech offers?
• Cctv instalation in homes, companies, bussineses premises and real estates.
• Computers upgradding.
• Data recovery.
• Digital home guarding.
• Digital car monitering.

C. Our Core Values (Pillars) are:

1. Discipline.
2. Excellence.
3. Integrity.
4. Entrepreneurship.
5. Responsbility.
D. Mag-tech Experience is :
  1. Thinking out of the box, new ideas are initiated to enhance our daily techno-friendly activities.
  2. Relevant- Appealing to our customers by responding to their needs and aspirations.

See more

Vision: To be the top in generation of techno-security companies throughout the world.
Objectives:
1. Invest in the  home securities
2. Invest in real estate
3. Giving advice on personal/organisations.
4. Organizing workshops and security seminars
5. Networking with like minded security groups
6. Giving back to the community through corporate social responsibility