Chapter -1 CONCEPT OF OBJECT ORIENTED PROGRAMMING It’s Need & Requirement :- There are many programming languages before Object Oriented Programming language.

Slides:



Advertisements
Similar presentations
Understand and appreciate Object Oriented Programming (OOP) Objects are self-contained modules or subroutines that contain data as well as the functions.
Advertisements

CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
Introduction To System Analysis and Design
Object Oriented System Development with VB .NET
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Guide To UNIX Using Linux Third Edition
ASP.NET Programming with C# and SQL Server First Edition
WEL COME PRAVEEN M JIGAJINNI PGT (Computer Science) MCA, MSc[IT], MTech[IT],MPhil (Comp.Sci), PGDCA, ADCA, Dc. Sc. & Engg.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
INTRODUCTION TO JAVA PROGRAMMING Chapter 1. What is Computer Programming?
C++ fundamentals.
OBJECT ORIENTED PROGRAMMING IN C++ LECTURE
The chapter will address the following questions:
Copyright 2003 Scott/Jones Publishing Brief Version of Starting Out with C++, 4th Edition Chapter 1 Introduction to Computers and Programming.
COMPUTER PROGRAMMING. Introduction to C++ History Merges notions from Smalltalk and notions from C The class concept was borrowed from Simular67 Developed.
Copyright © 2012 Pearson Education, Inc. Chapter 1: Introduction to Computers and Programming.
Introduction To System Analysis and design
OOP- OBJECT OBJECT PROGRAMMING By KRATI SHARMA 02 XI-B ✏✏✏✏ ☺☻☺☻☺☻☺ ✏✏✏✏
Programming Languages and Paradigms Object-Oriented Programming.
CSM-Java Programming-I Spring,2005 Introduction to Objects and Classes Lesson - 1.
Microsoft Visual Basic 2005: Reloaded Second Edition
Introduction to Object-oriented programming and software development Lecture 1.
GENERAL CONCEPTS OF OOPS INTRODUCTION With rapidly changing world and highly competitive and versatile nature of industry, the operations are becoming.
MT311 Java Application Development and Programming Languages Li Tak Sing( 李德成 )
O BJECT O RIENTATION F UNDAMENTALS Prepared by: Gunjan Chhabra.
An Object-Oriented Approach to Programming Logic and Design
CONCEPTS OF OBJECT ORIENTED PROGRAMMING. Topics To Be Discussed………………………. Objects Classes Data Abstraction and Encapsulation Inheritance Polymorphism.
Introduction To System Analysis and Design
11 Chapter 11 Object-Oriented Databases Database Systems: Design, Implementation, and Management 4th Edition Peter Rob & Carlos Coronel.
CSCI-383 Object-Oriented Programming & Design Lecture 13.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
Programming Fundamentals. Today’s Lecture Why do we need Object Oriented Language C++ and C Basics of a typical C++ Environment Basic Program Construction.
Course Title: Introduction to C++ Course Instructor: ADEEL ANJUM Chapter No: 01 1 BY ADEEL ANJUM (MCS, CCNA,WEB DEVELOPER)
An Object-Oriented Approach to Programming Logic and Design Fourth Edition Chapter 6 Using Methods.
CSSE501 Object-Oriented Development. Chapter 4: Classes and Methods  Chapters 4 and 5 present two sides of OOP: Chapter 4 discusses the static, compile.
C++ Programming Basic Learning Prepared By The Smartpath Information systems
Introduction to c++ programming - object oriented programming concepts - Structured Vs OOP. Classes and objects - class definition - Objects - class scope.
Learners Support Publications Object Oriented Programming.
9-Dec Dec-15  INTRODUCTION.  FEATURES OF OOP.  ORGANIZATION OF DATA & FUNCTION IN OOP.  OOP’S DESIGN.
Introduction to Object-Oriented Programming Lesson 2.
نظام المحاضرات الالكترونينظام المحاضرات الالكتروني Introduction to Object Oriented Programming (OOP) Object Oriented programming is method of programming.
Introduction To OOP 1.0 Fundamentals Of Java Programming Language 2.0 Exception Handling 3.0 Classes, Inheritance And Polymorphism © 2011 | PN AZRINA.
Learners Support Publications Introduction to C++
Course Title Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
OOPS CONCEPT.  OOPS  Benefits of OOPs  OOPs Principles  Class  Object Objectives.
Structure A Data structure is a collection of variable which can be same or different types. You can refer to a structure as a single variable, and to.
1 n Object Oriented Programming. 2 Introduction n procedure-oriented programming consists of writing a list of instructions and organizing these instructions.
Welcome to OBJECT ORIENTED PROGRAMMING Prepared By Prepared By : VINAY ALEXANDER PGT(CS) KV jhagrakhand.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
 The Object Oriented concepts was evolved for solving complex problems. Object- oriented software development started in the 1980s. Object-oriented design.
Lecture 3 (UNIT -1) SUNIL KUMAR CIT-UPES.
CHAPTER 5 GENERAL OOP CONCEPTS.
Object-Oriented Database Management System (ODBMS)
Objectives State the reasons for the complexity involved in the development of software Define the following terms Objects Classes Messages Methods Explain.
Objectives Identify the built-in data types in C++
Table of Contents Class Objects.
Chapter 3: Using Methods, Classes, and Objects
INTRODUCTION TO OBJECT-ORIENTED PROGRAMMING (OOP) & CONCEPTS
C++.
Lecture 1 Introduction.
Object Oriented Analysis and Design
Chapter 3 Introduction to Classes, Objects Methods and Strings
Procedural Programming
Principles of object – oriented programming UNIT-1 Chapter-1.
UNIT I OBJECT ORIENTED PROGRAMMING FUNDAMENTALS
COP 3330 Object-oriented Programming in C++
Introduction to Data Structure
Introduction to Object-Oriented Programming
Capitolo 1 – Introduction C++ Programming
Presentation transcript:

Chapter -1 CONCEPT OF OBJECT ORIENTED PROGRAMMING It’s Need & Requirement :- There are many programming languages before Object Oriented Programming language. But the basic reason behind invention of all languages is the need to handle the increasing complexity of programs that are reliable and maintainable.As the industry is growing rapidly, the need and requirements are changing according to the demands of Industry and these needs are increasing the complexity of software systems as well as competition in the industry. There are basic requirements to develop successful software & to meet them. Requirements: Language used should be capable of To represent real life entities of problems in system design. To reuse and extend modules. To develop modules those are tolerant to any changes in future. To increase software productivity, quality of software and decrease cost of software. To make software user friendly and provide security at the same time.

Procedure oriented programming: In procedure oriented programming, the problem is considered as a sequence of instruction to be done such as reading, calculating & printing. A number of functions are written to accomplish these tasks. The primary focus is on function. A technical Programming Structure for procedure oriented Programming is given below. Drawbacks: - In large programs, it is very difficult to identify what data is issued by which function. It does not model real world problem. Because function are action orien ted & do not correspond to the elements of the problem. Object Oriented programming: - The fundamental behind oops is to combine into a single unit both data & function that operate on data, such a unit is called an oop. Oop treats data as critical element in the theory programming development & does not allow it to flow freely around the system. It ties data more closely to function that operates it & protects it to flow around the system accidentally. Features of OOPS :- 1.Focus is on objects. 2.Data & function are tied together in data structure. 3.Data structure as are designed such that they characterized object. 4.Object may communicate with each other through functions. 5.Data is hidden and cannot be accessed by external functions. 6.New data and functions can be easily added whenever necessary.

Advantages of OOPS :- It offers a new & powerful way to cope with programming Complexity. It is clear, more reliable, easier to maintain program. It adds new oops features like encapsulation, inheritance polymorphism etc. It provides better data hiding to programming. It provides templates, which are used to operate on different Data types. Through inheritance we can eliminate redundant code & extended the use of existing classes. It is possible to map object in problem Domain to those programs It is easy to partition in a program based on object. Oops system can be easily upgraded from small to large system. Software complexity can be easily managed. Object Oriented Language: - The language should be support several of the object oriented programming concept. They can be classified into Two categories. Object Based programming Language. Object Oriented programming Language. List Of Object Oriented Programming Languages:- 1) Simula. 2) Smalltalk. 3) C++. 4) Eiffel. 5) Java. 6) Dot Net etc.

Applications of oops: - Real time system. Object Oriented database Artificial intelligence & expert sys. Hypertext, hypermedia. CAM/CAM sys. Parallel programming. Decision support & office automation system. Simulation & modeling Basic concept of oops: - Object: - It is a basic run time entities in an object Oriented system. They may represent a person place, bank acc. A table of data or any item that the program must handle. Programming problem is analyzed in terms of objects and the nature of communication between them. When program is executed, the object interacts by sending messages to one another. Each object contains data and code to manipulate the data. Objects can interact without having to know details of each other’s data or code. For example, if “customer” and “account” are two objects in a program, then customer object can send a message to the account object requesting for the bank balance.

Classes: - 1. Classes that they contain data & code to manipulation data type. 2. Once class has been defined, we can create any number of objects belonging to that class. 3.For example, fruit is the class, the syntax used to create an object is fruit mango; Where mango is the class variable, which is also called object. 4.Classes are user defined data types & behave like a built in types of a programming language. Data Encapsulation : - It means wrapping of data and functions into a single unit(called class). The data is not accessible to the outside world and only those functions, which are wrapped in the class, can access it. These functions provide the interface between the object’s data and the program. This insulation of the data from direct access by the program is called data hiding. Data Abstraction : - It refers to the act of representing essential features without including the background details or explanation. Classes use the concept of abstraction and are defined as a list of abstract attributes such as size, weight and cost and functions operate on these attributes.

3.They encapsulate all the essential properties of the objects that are to be created. Since the classes uses the concept of data abstraction, they known as abstract data types. 4.It provides ability to create user defined data types. Inheritance: - 1.It allows extension & reuse of existing the code without having rewritten the code from scratch. 2.Inheritance involves the creation of new classes from existing one. 3.Inheritance provides the important feature of OOP that is reusability. 4.The old class is referred as base class and new class is called the derived class. The new classes have combined features of both the classes. 5.There are different types of inheritance process like single inheritance, multiple inheritance, multilevel inheritance, hierarchical inheritance etc. Polymorphism: Polymorphism means many forms.It is the ability to take more than one form. In object oriented programming, polymorphism refers to identically named method i.e. member functions that have a different behavior depending on the type of object they refers.

3.In object oriented programming, polymorphism refers to identically named method i.e. member functions that have a different behavior depending on the type of object they refers. 4.For example, an operation may exhibit different behavior in different instances. The behavior depends upon the types of data used in the operation. There are basically two types of polymorphism. 1.Compile time polymorphism 2.Runtime polymorphism. Dynamic binding: - Binding refers to the lining of a procedure call to the code to be executed in response to the call. Dynamic binding means that the code associated with a given procedure call is not known until the time of the call at run time. Dynamic binding is associated with polymorphism and inheritance.

Message passing: As the object oriented program consists of a set of objects that communicate with each other. The process of programming in an object-oriented language therefore involves the following basic steps: 1. Creating classes that defines objects and their behaviors. 2. Creating objects from class definitions. 3. Establishing communicate among objects. 1. Object communicates with one another by sending and receiving information. 2.A message for an object is a request for execution of a procedure, and therefore will invoke a function (procedure) in receiving object that generates the desired results. 3.Message passing involves specifying the name of the object, the name of the function (message) and the information to be sent. Objects have a life cycle. They can be created and destroyed. Communication with an object is feasible as long as it is alive.

Beginning With C++ :- What is c++: - C++ is object oriented programming. It was developed By bjarne strousrup at & bell lab. C++ is an extension of with major ads of class construct feature & simula 67. Strousrup initially called new language c with classes how ever later in 1983 the name was changed to c++. Comments: - C++ introduces New comment symbol “//” (double slash comment) start with this symbol terminated at the end of line. A comment may start from anywhere the line & what ever follows till the end of line is ignored there is no closing symbol This is a single line comment multiline are written as follows. a. // c++ prog. b. /* Data code */ Output operator : The ouput statement in program is Cout << “welcome to world of c++”; Causes the string in quotation marks to be displayed on the screen. The identifier cout is predefined object that represens the standard output stream in c++. Here, the output stream represents the screen. It is also possible to redirect the output to other output devices. The operator << is called the insertion or put to operator. It inserts or sends the contents of the variable on its right to the object on its left. The object cout has simple interface. If ‘str’ represents a string variable, then the following statement will display its contents Cout << str; The operator << is the bit wise left-shift operator and it can be still used for this purpose.

Input operator: He statement in program is cin >> number; Is an input statement and causes the program to wait for the user to type in a number. The number keyed in is placed in the variable number. The identifier cin is predefined object in c++ that corresponds to the standard input stream. Here, the stream represents the keyboard. The operator >> is known as extraction or get from operator. It extracts or takes the value from the keyboard and assigns it to the variable on its.”. Structure of c++ program: A Typical C++ program would contains four section as shown in the following figure. These section may be placed in separate code files and then compiled independently. 1.Header files include start of the program. 2.The class declaration are placed in header file. 3.Definition of member class go into another file. 4.The main program that uses the class is placed in third file.

Example :- #include Class student { Int roll_no; Char name[10]; Public: Void accept(); }; Void student::accept() { Cout<<”enter student name and roll no”; Cin>>roll_no>>name; } Void main() { Student s; s.accept(); }

Concept of Structure: - The structure is a convenient tool for handling a group of logically related data items. It is user defined data types. Structure provides a method for packing together the data different types of data. Once the structure type has been defined, we can create a variable of that structure type using declaration that same to built in type declaration. Declaration a structure :- struct [struct_name] { data_type member_name ; data_type member_name ;. } [structure_variables]; For example:- struct stud { char name [20]; int roll_no; float total; };a1,a2,a3; or Struct stud a1,a2,a3; The keyword struct declared stud as a new data type that can be hold 3 fields of different Data types. Fields are known as structure Member Or element. The identifier Stud which is referred to as struct name.

Union: - These are the derived data types same as structure. Both structure & union are used to group no of different variable together. Structure enables as to treat the same space for a no different Variables and union occupies the largest memory of member for all members. union a { int i; char i; char ch [2]; }key; where union is a keyword, a is name of union and key is name of union variable.