Skip to main content

12th HSC free notes of c++ language theory part 3

 Object oriented programming

• Object oriented programming is an approach that provides a way of modularizing programs by creating partitioned memory area for both data and function that can be used as templates for creating copies of such modules on demand .
• In object oriented programming the program is designed around the data being operated upon rather than upon the operation themselves.
• OOP allows to decompose a problem into a number of entities called object and then build data and function around these entity.
• When program is executed the object interact by sending message to one another
• Each object contains data and code to manipulate the data .

Features of OOP :
• Program are divided into number of object.
• Data is hidden and cannot be accessed by external function
• Object may communicate with each other through function
• New data and function can be easily added wherever required.
Object :
• Object are the basic runtime entity in object oriented system .
• For e.g they may represent a person , a place , a bank.
• Programming problem is analyzed in term of object and the nature of communication between them .
• Program object should be chosen such that they match closely with the real world object .

Class :
• Class is way to bind a data and is associated functions together.
• The entire set of data and code of an object can be made an user define datatype with the help of class
• Infact an object is nothing but a variable whose datatype is class
• Once a class has been define user define any number of object belonging to that class
• Class is a collection of object of similar type.

What are friendly function? Give the characteristics of a friendly function .
 C++ allows the common function to be made friendly with more than one classes , thereby allowing the function to have access to the private data of class . Such a function need not be a member of any classes.
 Non-member function cannot have access to the private data of a class . However , there could be a situation where user would like two classes to share a particular function. At this situation friend function is used.
 The keyboard “ friend ” declare the function to be friendly with that class. This function is defined as a normal c++ function . The function definition does not use class – name , keyboard friend or scope resolution operator.
 A friend function has following characteristics :
(1) It is not in the scope of the class to which it has been declared as friend .
(2) since it is not in scope of the class, it cannot be called by using object of that class . It is called like a normal c++ function .
(3) It can be declared either in public or the private part of a class without affecting is meaning .
(4) Usually , it has the objects as arguments.
(5) It cannot access the member function directly and has to use an object name and dot operator with each member name .

Comments

Popular posts from this blog

partitioning (operatimg system ).

 WHAT IS PARTITIONING ? Certain operating system use partitioned memory management to allow multiprogramming . • Partitioning means dividing main memory into various sections.  • These section are called as partitions.  • There are two types of partitions: 1) fixed partition .    2) variable partition.   Fixed partition  .  • In this method partitions are fixed at the time of system generation . At this time , system manager has to declear partition time.  • Fixed partition are also called static partition . On declearing fixed partition , the operating system create partition description table.  • It reduces the uses the CPU utiliisation .  • It reduces the degree of multiprogramming. .    variable partition .     In variable partition number of partition and their size are variable  • They are not defined at the time of system generation .  • These partition are created by operating systems...

Important MCQ and imp programs of html and c++.

  Some important MCQ . Ans. :- a)-i) , b)- i) , c)- iii) , d)- iii)                        Ans. :- a)- ii) , b)- iii) , c) - iii) , d)- ii)                         Ans.:- a)- ii) , b) - i), c) - iii) , d) - ii)                        And. :- a)- iii) , b)- ii) , c)- iii) , d) - iii)                       Ans. :- a) - ii) , b) - i), c)- iii) , d) - iii)                      Some important previous year questions of programming. 1) 2) 3) 4)

Free notes of the operating system some imp questions

 1. ALU  2. STACK POINTER 3. PROGRAM COUNTER 4. INSTRUCTION REGISTER AND DECODER ALU ( ARITHMATIC AND LOGIC UNIT ) It is 8 bit unit  In this arithmetic and logical operation are carried out . ALU contain the binary adder to perform addition substracion by 2’s complement method Data is supplied by memory devices and input ouput devices The result is typically stored in the accumulator. STACK POINTER:- Stack poiointer is a 16 bit register which contain the address of top of stack With the help of incrementer and decrementer stack pointer perform their work The stack pointer is incremented when data is push  The stack pointer is decrementd when data is pop. INSTRUCTION REGISTER AND DECODER :- During the instruction fetch, the first 8 bit of instruction is transfer to the 8 bit instruction register The content of instruction register are available to the instruction decoder The output of decoder get by timing signals, ALU & data buffer. PROGRAM COUNTER:- Program coun...