Skip to main content

Posts

Swapping Private data of classes

  CASE 1:  Given two numbers a & b, swap these two numbers using the friend function of C++.  Examples:   Input : a = 5, b = 9 Output : a = 9, b = 5 Input : a = 4, b = 6 Output : a= 6, b = 4 Approach:  Create a class Swap, declare one variable in it, i.e., num, and create a constructor for inputs. Declare a friend function in it. Define the friend function outside the class scope by taking arguments as call by reference to pass the copy of Swap Object. Perform the swap operation.
Recent posts

Static Member Functions

  What is static member functions? A static member function can access static data members and static member functions inside or outside of the class. Static member functions have a scope inside the class and cannot access the current object pointer. You can also use a static member function to determine how many objects of the class have been created. Static Member Function in a class is the function that is declared as static because of which function attains certain properties as defined below: A static member function is independent of any object of the class.  A static member function can be called even if no objects of the class exist. A static member function can also be accessed using the class name through the scope resolution operator. A static member function can access static data members and static member functions inside or outside of the class. Static member functions have a scope inside the class and cannot access the current object pointer. You can also use a static me

Static Data Member

 A data member of a class can be qualified as statics. The properties of a static member variable are similar to that of a C static variable. A static member variable has certain special characteristics. These are: It is initialized to zero when the first object of its class is created. No other initialization is permitted. Only one copy of that member is created for the entire class and is shared by all the objectives of that class, no matter how many objects are created. It is visible only within the class, but its lifetime is the entire program. #include <iostream> using namespace std; class item {        static int count;        int number;        public:        void getdata(int a)        {            number=a;            count ++;        }        void getcount(void)        {            cout<< "count";            cout<< count <<"\n";        } }; int item::count; int main() {         item a,b,c;         a.getcount();         b.getcount();

Array of Objects

An array can be of any data type including struct. Similarly, we can also have arrays of variables of the type class. Such variables are called arrays of objects. Class Definition: class employee {           char name[30];          float age;     public:          void getdata(void);           void putdata(void); }; The identifier employee is a user-defined data type and can be used to create objects related to different employee categories. employee manage[3];          //aray of managers employee foreman[15];       //array of foreman employee worker[75];        // array of worker the array manager contains three objects(managers), namely, manager[0],  manager[1], and manager[2], of type employee class similarly, the foreman array contains 15 objects. and the worker array contains 75 objectives.(workers).

Lab 2

 Ethical Hacking Lab programs 1.        Write the steps for installing Kali Linux in windows? 2.       Write a program for Phishing Attacks 3.       The real-time practice of Injections which mainly includes SQL Injection 4.       Write a program for TCP/IP High Jacking 5.       Write a program for Social Engineering 6.       Write a program for Administrative password cracking 7.       Write a program for Hacking windows 7, windows 8, and windows 10 using Metasploit 8.       Write a program for Hacking Windows 7, 8 , and 10 using backdoor 9.       Write a program for Google Hacking 10.   Write a program for Email Spoofing

LAB

 Big Data Analytics Lab Programs 1.        Implement the following Data structures in Java for Linked Lists 2.    Perform setting up and Installing Hadoop in its three operating modes: Standalone, Pseudo distributed, Fully distributed 3.        Implement the following Data structures in Java for Stack 4.        Install and Run Pig then write Pig Latin scripts to sort, group, join, project, and filter your data 5.        Implement the following Data structures in Java for Queues 6.        Write a MapReduce program to search for a specific keyword in a file 7.        Implement the following Data structures in Java for Set 8.      Write a MapReduce program to count the occurrence of similar words in a file. Use partitioner to partition key based on alphabets 9.        Implement the following Data structures in Java for Map 10.   Implement the following file management tasks in Hadoop: 1. Adding files and directories 2. Retrieving files 3. Deleting files 11.    Run a basic Word Count Map R