programming-lanaguage

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

Unit 2:

Programming Language: Programming language


is a language of computer which instructs the
computer to perform certain task. There are
different programming language and all the
languages have their own syntax to write the
program. In other word, by using or writing the
code in programming language the programming
can develop the different application software.
Some of the example of programming languages
are C, C++, Java, Visual Basic (VB) etc.
Generations of programming languages:
1. First generation programming Language:(1
GL)
This generation of programming language
use the machine level language i.e 0 and 1
to write the program. It is also called low
level P.L. It is very difficult to write the
program in this language. The program
written for one CPU will not execute in
another CPU i.e program in this language is
machine dependent. To write the program
in this language the programmer should
have knowledge of internal architecture of
computer system.
Advantages of First generation P.L
1. The program written in this language doesn’t
require translator because the program is
directly written in binary form.
2. The program in this language execute faster.
3. The program written in this language utilize
the memory in effective manner.
Disadvantages of First generation P.L
1. It is very difficult to write the program in this
language
2. The program written in this language can not
be easily understood by the person who
haven’t got the knowledge of machine level
P.L.
3. The program written in this language is
difficult to debug the errors.
4. The programmer have to write large number
of instructions to perform small task.
5. The program written in this language is
machine dependent i.e program written for
one CPU doesn’t execute in another CPU.
Second Generation P.L.
This P.L. also belongs to low level P.L. This
language is also called assembly language. It uses
the concept of mnemonics (symbol) in place of 0
and 1. It makes the programming work a little bit
easier as compared to first generation.
Advantages of second Generation P.L.
1. It is easy to write the program in this
language as compared to first generation.
2. It is easy to debug the program written in
this language.
Disadvantages of second generation P.L.
1. The program in this language execute
slowly because it requires translator
called assembler.
2. The program in this language is machine
dependent
3. To write the program in this language the
programmer should have knowledge of
internal architecture of computer
system.
4. The assembly language programs like the
machine language is still result in poor
productivity.
Third generation P.L.
This language is design to overcome the problem
of second generation P.L. The languages of this
generation belongs to high level P.L. The
programmer can use human languages to write
the program. This language is user friendly. This
language is also called procedure language.
Advantages:
1. It is easy to learn and understand.
2. The program in this language is highly
portable i.e program written in one CPU will
be executed by another CPU.(Not machine
dependent).
3. The program can be developed in less time
as compared to first and second generation
P.L.
4. The program in this language is easy to
debug.
Disadvantages:
1. The program in this language execute slowly
because it requires translator called
compiler or interpreter.
2. The program in this language requires more
memory as compared to first and second
generation.
3. Some task like manipulating individual bits
and register cannot be performed by this
generation P.L.

4. Fourth generation P.L.


The language of this generation is consider
to be more user friendly and it is very high
level P.L. It is non procedure language in
which user have to specify what task is to be
done not how to perform the task. In this
generation the concept of database
management system was
introduced(DBMS). E.g structure Query
language (SQL).

Advantages:
1. It is easier to learn and use, it allows non
programmer to develop the program.
2. It requires less time and effort to develop
the program.
3. It allows the efficient use of data by
implementing database concept.
4. The program in this language is highly
portable.
Disadvantages:
1. The program in this language execute slowly
because translator is required.
2. The program in this language requires more
memory.
3. It also can’t perform some hardware related
task.
5. Fifth generation P.L.
The language of this generation mainly focus on
constraint programming. It is a programming
method in which the programmer only need to
specify the solution to be found, rather than
specifying the method. The major field in which
5th generation language is used is Artificial
Intelligence (AI) . Eg. Mercury, Prolog etc
Advantages:
1. This P.L. allows the user to communicate
with computer system in easy manner.
2. The P.L. can be used to query the database
in fast and effective manner.
Disadvantages:
1. It requires more memory.
2. It execute slowly because it also requires
translator.

Compiler: it is a translator which translate the


whole program at once. So, it is faster. Using this
translator the debugging task become complex.
Interpreter: It translates the program one line at
a time. So, it is slow. The debugging task become
easier.
Algorithm and Flowchart:
Algorithm is a set or step of procedure in a
precise order which defines certain task to be
performed. It is a sequence of steps which is
carried out in order to solve any given problem.
In other word, algorithm is a set of steps which
describe the process to solve any problem. It is
step by step the logical representation of any
program. It helps to define what action should be
performed in each phase of program
development cycle.
Characteristics of algorithm:
1. An algorithm should have one or more input.
2. An algorithm should produce at least one
output.
3. It should be finite i.e it should be finished in
finite number of steps.
4. An algorithm should be effective i.e each
instructions used in algorithm should be easy
to perform the given task.
Advantages:
1. It is language independent i.e we can
use same algorithm for different
programming language.
2. It makes easy to understand complex
problem.
3. It makes easy to convert the problem
into programming code.
4. There is no standard format or syntax
for developing it.
5. It makes easy to find out the error and
debug it.

Disadvantage:
1. It is time consuming.

Flowchart: Flowchart is graphical or


pictorial representation of an algorithm.
It is like a blue print for any problem.
Flowchart uses special symbols to
represent different action. The different
symbols are:
Advantages of flowchart:
1. The logic of algorithm can be
described in effective manner with the
help of flowchart in pictorial
representation.
2. It is used to measure the goodness or
quality of algorithm
3. It makes easy to code the program.
4. With the help of flowchart errors in
the program can be easily detected.
5. It is effective communication tool.
6. It is the part of software design hence
it makes the maintaining of program
easier.
7. It is useful in case of modification of
program in the future.
Disadvantages of flowchart
1. It is difficult to remember symbols.
2. It is time consuming.
3. To write good flowchart an expert
manpower is required.
Q) Write down the algorithm and flowchart to add
any two numbers.

You might also like