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

Free notes of all naming reactions .(handwritten notes jee, neet, mht-cet)

All naming reactions  (Handwritten notes.)                   organic chemistry naming reactions.

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)

Question bank of operating system CS.

  Question Bank Standard:- 12th Subject:- Computer Science (D9) Paper I March 2021 सूचना 1. फक्त शवद्यार्थ्यांना प्रश्नप्रकारांचा सराव करून देण्यासाठीच 2. सदर प्रश्नसंचातील प्रश्न बोर्डाच्या प्रश्नपशिके त येतीलच असे नाही याची नोंद घ्यावी. QUESTION BANK XII COMPUTER SCIENCE (D9) – PAPER I CHAPTER 1 – OPERATING SYSTEM MCQ – 1 Mark Q.No. Question Marking scheme 1. Operating system is a __________ i) hardware ii ) software iii) printer iv) input device 1 mark for correct alternative 2. ‘Open files’ is a system call provided under _________ of operating system. i) Information management ii) Process management iii) Memory management iv) GUI 1 mark for correct alternative 3. Program under execution is known as __________. i) File ii) Information iii) Data iv ) Process 1 mark for correct alternative 4. _______is a service of memory management of operating system. i) Copy a file ii) Suspend a Process iii) Allocate a chunk of memory iv) Open a directory 1 mark for correct alternative...