Unit-1 Programming Concept
Programming Concept
A set of instruction that is given to a computer to perform specific task is called
computer program. These instructions are written using programming language
and are stored in the storage devices of the computer as files. The systematic
method of making computer program is called programming. Computer program is
developed by using language which computer can understand. Some examples of
computer program are Microsoft word, page maker, Google chrome, etc. A person
who writes computer program is called programmer.
Concept of Programming language
Human beings can’t understand the computer language and computer can’t
understand the human language. So computer needs a special language to
communicate with the user. The languages which consist of a sets of symbols and
characters which are used while communicating with the computer are called
programming language. Computer can understand only binary code i.e. 0 and 1.
The programming languages are also called as artificial language.
There are two types of programming languages. They are:
• Low level language
• High level language
• Low level language
The language which computer can understand directly then it is known as low
level language. It is divided into two types:
• Machine level language(1GL)
• Assembly level language(2GL)
• Machine level language
The programming language whose data and instruction consist of binary
digit i.e. 0 and 1 is called machine level language. The program written in
machine level language is understood directly by the CPU and does not need
to be translated. Program developed in the machine level language will be
executed fast and utilized the primary memory efficiently. However, for the
humans it will be difficult to write a program in binary codes. Machine
language is machine dependent language which mean program written for
one model of computer will not work on another computer.
Advantages of machine level language
• Very fast program execution
• No need of translation program
• It can directly understand by the computer
Disadvantages of machine level language
• It is difficult to understand.
• It is a machine dependent language
• It is difficult to find errors
• Assembly level language
An assembly language is a low level programming language for
microprocessor and other programmable devices. An assembly language
implements a symbolic representation of the machine code needed to
program a given CPU architecture. It come in existence to overcome the
difficulties of machine level language instead of writing the instruction in
the series of binary codes we can use mnemonics like AND, OR, NOT,
SUB, MOV, MVI, CMP, etc along with the decimal number in order to
perform the different type of task and calculation .
Advantage of assembly level language
• It is easier to understand and modify.
• It is easy to locate and correct errors.
Disadvantages of assembly level language
• It is not directly understand by CPU.
• It needs translating program.
• High level language
A high level language is a programming language such as C, FORTRAN, or
PASCAL that enables a programmer to write program that are more or less
independent of a particular type of computer such language are considered
as high level language because they are closer to human language and
further from machine language. Every single program written in a high level
language must be interpreted into machine language before being executed
by the computer
Advantages of high level language
• It is easy to learn and understand
• It is easy to remove errors in the program.
• Program written in high level language is machine independent.
• It has better documentation.
• It is easily modify.
Disadvantages of high level language
• Program execution is slower.
• It is not directly understand by the processor for execution.
• It required more money.
High level language can be further categorized as:
• Procedural oriented language
• Object oriented language
• Natural language
Algorithm
Algorithm is a set or a step of procedures in a precised order which defines certain
tasks that should be performed. In another words, algorithm is a special description
of the flow of the program in simple English.
Development of algorithm: Under these step the following facts are used.
• Breaking down the problem complexity i.e. the problem is splitted into
several possible smallest parts.
• All the arranged parts are converted into simple English language imperative
sentences. These English languages are collectively called algorithm,
whereas each step of algorithm is an instruction called pseudo code.
Flowchart
The diagrammatical representation of algorithm using different graphical symbols,
shapes and tools which depicts the clear and complete concept about the problem
solution is called flowchart.
Flowchart use special shapes to represent different types of actions or steps. In a
flowchart process, lines and arrows show the sequence of the steps and the
relationships among them.
Pseudo code
Pseudo code is an informal way of writing programming description that does not
require any strict programming language syntax. It is used for creating an outline
or a rough draft of a program.
Pseudo code is not an actual programming language so it can’t be compiled into an
executable program. It was short terms or simple English language syntaxes to
write code for programs before it is actually converted into a specific programming
language. This is done to understand the programming data flows that the final
program is going to use.
Advantages of Pseudo code
• Pseudo code is understood by the programmers of all types.
• It enables the programmer to concentrate only on algorithm part of the code
development.
• It cannot be compiled into an executable form.
Example: if ‘i’ is less than ten, then increment ‘i’ by 1.
New paradigm of programming language
The procedural programming encourages the creation of smaller and reusable
procedures or methods in your code.
Objects oriented programming is a new paradigm of programming language that
uses objects and their interactions to design software. OOP is much more similar to
the way that real world works. Each program is made up of many entities and
objects. Objects can not directly access data instead a message must be sent. Just
like people must ask one another for information.
Difference between POP and OOPS
POP OOPs
POP emphasizes on algorithm i.e. OOP emphasizes in data rather than
Procedure procedure
Large Programs are divided into smaller Programs are divided into objects.
programs.
They do not have facility to hide data. They have facility to hide data.
There is no concept of inheritance, They are introduced with the concept of
polymorphism, Overloading, etc. inheritance, polymorphism,
Overloading, etc.
They follow top-bottom approach for They follow bottom-top approach for
program layout. program layout
Examples: C, COBOL, FORTRAN etc. Examples: C++, Java, C#.Net, [Link]
etc.
Event driven programming
In computer programming, event driven programming is a programming paradigm
in which the flow of the program is determined by events such as user actions
(mouse clicks, Key presses), sensor output or message from other programs or
threads.
The concept of event driven programming is an important one in application
development and other kinds of programming. An event driven program is also
known as an event driven application.
Event driven program can be written in any programming language. Virtually all
objects oriented and visual language support event driven programming. Visual
basics, visual C++ and java are examples of such languages.