2. What does a Computer Program do?
A computer program is:
– a set of instructions that tell a computer how to
perform a particular task.
3. A programming language is a set of rules
that provides a way of telling a computer
what operations to perform.
Some programming languages are written
for particular computing problems.
For example,
FORTRAN for scientific applications
COBOL for business applications
What is a Programming Language?
4. English is a natural language. It has
words, symbols and grammatical rules.
A programming language also has
words, symbols and rules of grammar.
The grammatical rules are called syntax.
Each programming language has a
different set of syntax rules.
Programming Language
5. Types of Programming Languages
High-Level Language
class Triangle {
...
float surface()
return b*h/2;
}
Middle -Level Language
LOAD r1,b
LOAD r2,h
MUL r1,r2
DIV r1,#2
RET
Low-Level Language / Executable
Machine code
0001001001000101001001
001110110010101101001.
..
6. Machine languages (first-generation
languages) are the most basic type of
computer languages, consisting of strings
of numbers the computer's hardware can
use.
Different types of hardware use different
machine code.
For example, IBM computers use different
machine language than Apple computers.
Machine Languages
7. In machine languages, instructions are
written as sequence of 1s and 0s, called
bits, that a computer can understand
directly.
It tells the computer,
Where to find one or two numbers or simple
pieces of data in the main memory
To perform simple operations like add two
numbers
Where in the main memory to put the result
Where to find the next instruction to perform
Machine Languages
8. The only language that the computer
understands is called binary or machine
language.
Programs interact with the computer using
machine language.
It’s difficult for humans to read or write so an
intermediate language is used to get it translated
into binary for us.
Machine Languages
9. Assembly languages (second-generation
languages) are only somewhat easier to
work with than machine languages.
To create programs in assembly language,
developers use cryptic English-like phrases
to represent strings of numbers.
The code is then translated into object code,
using a translator called an assembler.
Assembly Languages
11. Closer to English but included simple
mathematical notation.
Programs written in source code which
must be translated into machine language
programs called object code.
The programmer generates the source
code.
The interpreter or compiler generates the
object code (machine code)
Higher-Level Languages
12. Translating High Level Languages
to Machine Code`
Two ways to generate object code:
• An interpreter translates the high-level
instructions into machine code, line by
line, as the program is running
• A compiler translates the entire program
into machine code before running the
program
13. • Third-generation languages
• Fourth-generation languages
• Fifth-generation languages
Higher-level programming languages are
divided into three "generations," each
more powerful than the last:
Higher-Level Languages
14. FORTAN C
COBOL C++
BASIC Java
Pascal ActiveX
• Third-generation languages (3GLs) are the first to
use true English-like phrasing, making them easier
to use than previous languages.
• 3GLs are portable, meaning the object code created
for one type of system can be translated for use on a
different type of system.
• The following languages are 3GLs:
Higher-Level Languages –
Third-Generation Languages
15. Visual Basic (VB)
VisualAge
Authoring environments
• Fourth-generation languages (4GLs) are even easier
to use than 3GLs.
• 4GLs may use a text-based environment (like a 3GL)
or may allow the programmer to work in a visual
environment, using graphical tools.
• The following languages are 4GLs:
Higher-Level Languages -
Fourth-Generation Languages
16. • Fifth-generation languages (5GLs) are an issue of
debate in the programming community – some
programmers cannot agree that they even exist.
• These high-level languages would use artificial
intelligence to create software, making 5GLs extremely
difficult to develop.
• PROLOG – A language used to program Artificial
Intelligence
Higher-Level Languages -
Fifth-Generation Languages
17. FORTRAN
FORmula TRANslation.
Developed by John Backus
Developed at IBM in the mid-1950s.
Designed for scientific and mathematical
applications by scientists and engineers.
Procedural Languages
18. COBOL
COmmon Business Oriented Language.
Developed in 1959.
Created by Grace Hopper
Designed to be common to many different
computers.
Typically used for business applications.
Procedural Languages
19. LISP
LISt Processing.
Developed in 1958.
Created by John McCarthy
First Functional Language
Functional Language
20. BASIC
Beginner’s All-purpose Symbolic Instruction
Code.
Developed at Dartmouth College in mid 1960s.
Developed as a simple language for students
to write programs with which they could
interact through terminals.
Programming Languages
21. C
Developed by Bell Laboratories in the early
1970s.
Provides control and efficiency of assembly
language while having third generation
language features.
Often used for system programs.
UNIX is written in C.
Programming Languages
22. SIMULA
First object-oriented language
Developed by Ole Johan Dahl in the 1960s.
SMALLTALK
First purely object-oriented language.
Developed by Xerox in mid-1970s.
Still in use on some computers.
Object-Oriented Programming
Languages
23. C++
It is C language with additional features.
Widely used for developing system and
application software.
Graphical user interfaces can be developed
easily with visual programming tools.
Object-Oriented Programming
Languages
24. JAVA
An object-oriented language similar to C++
that eliminates lots of C++’s problematic
features
Allows a web page developer to create
programs for applications, called applets that
can be used through a browser.
Objective of JAVA developers is that it be
machine, platform and operating system
independent.
Object-Oriented Programming
Languages
25. Chapter 3 (Questions)
What is program?
What is programming Language?
What are the different programming
language generations?
What are the differences between
HLL and LLL?
Explain computer language types
with example.