There is no substitute for HARD WORK.
--Your friends at LectureNotes

Note for Object Oriented Programming Using Cpp - OOP By MOSHECK MENTA

  • Object Oriented Programming Using Cpp - OOP
  • Note
  • kshatriya college of engineering - KCEa
  • Computer Science Engineering
  • 4 Topics
  • 1 Offline Downloads
  • Uploaded 11 months ago
Mosheck Menta
Mosheck Menta
0 User(s)
Download PDFOrder Printed Copy

Share it with your friends

Leave your Comments

Text from page-1

DIPLOMA-III-SEM-DCME OOP Through C++ C++ history:➢ C++ programming language was developed in 1980 by Bjarne Stroustrup at bell laboratories of AT&T (American Telephone & Telegraph), located in U.S.A. ➢ Bjarne Stroustrup is known as the founder of C++ language. ➢ It was develop for adding a feature of OOP (Object Oriented Programming) in C without significantly changing the C component. ➢ C++ programming is "relative" (called a superset) of C, it means any valid C program is also a valid C++ program. Language Year Developed By Algol 1960 International Group BCPL 1967 Martin Richard B 1970 Ken Thompson Traditional C 1972 Dennis Ritchie K&RC 1978 Kernighan & Dennis Ritchie C++ 1980 Bjarne Stroustrup 1.1-Evolution of oop Kshatriya College Of Engineering-KCEA Page 1

Text from page-2

DIPLOMA-III-SEM-DCME OOP Through C++ Object Oriented Programming Approach: ➢ The OOP approach came into existence to remove the drawback of conventional approaches. ➢ The basic principal of the OOP approach is to combine both data and functions ➢ Such a unit is called an Object. ➢ This approach secures data also. ➢ The programming languages: C++ and JAVA follow this approach 1.2-State principle of object oriented programming language:➢ Object oriented languages are classified in to two types ➢ They are 1)Object-based programming language 2)Object-Oriented language 1) Object-based programming language:These programmings are a) Data encapsulation b) Data hiding and access mechanisms(Data Abstraction) c) Automatic initialisation and clear up of objects d) Operator Overloading 2)Object-Oriented language:- Kshatriya College Of Engineering-KCEA Page 2

Text from page-3

DIPLOMA-III-SEM-DCME OOP Through C++ These programmings are a) Object-based features b) Inheritance c) Dynamic binding(Overidding) Note:Data encapsulation:➢ Encapsulation is the mechanism which binds keep together code and data further future reference use.(ex: saving money in account) Data abstraction:➢ Abstraction is nothing but hiding the details(ex: out side car face in single but inside more parts like as steering , a.c, seats, mini tv and others) Polymorphism:➢ ➢ ➢ ➢ Poly means “many” and morphism means “forms” Polymorphism means “many forms” Polymorphism are classified in to two types They are 1)Compile-Time-polymorphism/Overloading/early-binding/static binding 2)Run-Time-polymorphism/Overriding/late-binding/Dynamic binding Inheritance:➢ Inheritance is the process of access acquires the properities of another class object. ➢ These are 5 types of inheritances a) Simple/Basic Inheritance b) Multiple Inheritances c) Hierarchical Inheritance d) Multi-Level Inheritance e) Hybrid Inheritance 1.3-Explain OOP’s properities like a encapsulation and Polymorphism Kshatriya College Of Engineering-KCEA Page 3

Text from page-4

DIPLOMA-III-SEM-DCME OOP Through C++ Ans:-read above encapsulation and polymorphism 1.4-Create,Compile,link and execute a C++ program Ans:-create-type c++ program(ex:student.cpp) Compile:- Use Alt + F9(student.cpp->student.obj) Link and execute:-link->run(Use Ctrl + F9) (student.obj->student.exe) 1.5-Differentiate C , C++(difference between c and c++) No. C C++ 1) C follows the procedural style programming. C++ is multi-paradigm. It both procedural and object oriented. 2) Data is less secured in C. In C++, you can use modifiers for class members to make it inaccessible for outside users. 3) C follows the top-down approach. C++ follows the bottom-up approach. 4) C does not support function overloading. C++ supports function overloading. 5) In C, you can't use functions in structure. In C++, you can use functions in structure. 6) C does not support reference variables. C++ supports reference variables. 7) In C, scanf() and printf() are mainly used for input/output. C++ mainly uses stream cin and cout to perform input and output operations. Kshatriya College Of Engineering-KCEA supports Page 4

Lecture Notes