Monday 19 May 2014

Object oriented programming




 Introduction

Object oriented programming(oop) is used to build oops. objects are the basic building block of object oriented programming system(oops)

The real world objects have two characteristics: state and behavior.

 For example human beings have state such as name, color, age, and height and behaviors such as walking, dancing and sleeping.

Oops consists of following features.   
       Encapsulation
       Abstraction
       Inheritance
       Polymorphism

Encapsulation:

Encapsulation implies that the non-essential details of an object are hidden from the user and an access is provided to its essential details. therefore, encapsulation is also information hiding.
For example when  you switch on the TV the TV starting showing movies. you don’t have to know what is happening in the internal electrical circuits and cathode ray tube and that is hidden from the viewer

Abstraction:

In object oriented, programming, abstraction means ignoring the non essential; details of an object and concentrating on essential details.
To implement abstraction , you also use the encapsulation feature . encapsulation hides the irrelevant details of an object and abstraction makes only relevant features of an object visible.

Inheritance:
In object oriented methodology , inheritance enables you to extend the functionality   of an existing class. you create a class inherits attributes and behavior of another class. in addition , a new class can consist of a few new attributes and behavior that are specific to the class. In terms of classes and objects, attributes refer to the data  and behavior refer to methods.

Polymorphism:
Polymorphism is derived from lathin words poly, which means many, and morph, which means forms.  Anything that exists in more than one form is known as poly morph.
In object oriented methodology, polymorphism is the feature that enables you to assign a different meaning or usage to an entity  in different contexts. the entity can be a variable, method, or an object. Polymorphism enables an entity to have more than one form depending upon the context in which it is used.

Sunday 18 May 2014

C Language Tutorial

chapter-1


What is c? 

it is a programming language
Commonly software is split into two types. They are
1. Language
2. Package.


What is package?


Example are ms-word, excel.


Packages are already predefined .That is if we want to format a paragraph there are icons in word software such as bold and italic by just clicking these icons we can format text. That is what should happen when we click bold icon is already predefined.


what is language

Opposite to it in programming language there will be set of statements. By executing these statements we can make solution to a problem. We can make packages using languages . that is what should happen in a package when events such as clicking a bold icon are defined through programming language.


We can also write operating system using languages like c.


What is an operating system?


Operating system is also software. It comes in the type of system software. This soft ware manages the system . i.e allocating memory to an application or setting priorities to software such as which should run first. It is also act as a interface between system and user. 


Examples for operating system are


1. Windows xp
2. Windows 7
3. Unix
4. Linux


In 1972 at bell laboratories, USA a research of developing UNIX operating system was going on. To write UNIX operating system they needed a language. So they were in the need of a programming language. So they developed c language. So the reason behind invention of c is to write UNIX operating system.


C is a portable language.


Why it is called as portable language?


A program written in c language in one platform can be run on another platform without change. So c is called as portable language.


C is powerful
C is structure oriented language.
C is not an object oriented programming language.
C can be used to write high level business applications. At the same time it can be used for low level assembly programs. As it can be used for both high level and low level programming it is called as middle level language.


Applications of c:


1. C is basic language for learning advanced languages like c++, java c#.
2. C is used in field of graphics
3. Used for creating system level programming. It is used for creating operating system, compilers.


What is a compiler?


Source code written in a programming language cannot be understood by system. There is an equal binary code for source code. The binary code contain only I’s and 0’s and it can be under stand by system. The role of compiler is to change source code in to machine language.