0% found this document useful (0 votes)
21 views

Computer Education Slides

The document discusses the evolution of computer programming languages from machine language to modern high-level languages like Java, C++, and Python. It covers early assembly languages and generations of programming languages including procedural, object-oriented, logic, and web languages. Examples are provided of popular languages used in different industries like Java, C, C++, and PHP.

Uploaded by

Ayesha Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
21 views

Computer Education Slides

The document discusses the evolution of computer programming languages from machine language to modern high-level languages like Java, C++, and Python. It covers early assembly languages and generations of programming languages including procedural, object-oriented, logic, and web languages. Examples are provided of popular languages used in different industries like Java, C, C++, and PHP.

Uploaded by

Ayesha Ahmed
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

COMPUTER PROGRAMS

AND LANGUAGES
Developing a computer program
Programs are a set (series) of instructions

Programmers determine
• The instructions to be performed.
• The order in which those instructions are to
be performed.
• The data required to perform those
instructions.
Program Development- Where to start?
Algorithms
The most basic tools that are used to develop
the problem-solving logic
• steps are unambiguous
• a finite number of steps
• that repeat (iterate)
• require decisions (logic and comparison) until the
task is completed

Different algorithms may accomplish the same


task, with a different set of instructions, in
more or less the same time, space, and
efforts.
Example-
Flowcharts
A pictorial representation of an algorithm
• steps in the form of different shapes of boxes
• logical flow (sequence) by interconnecting
arrows
• help the programmer in understanding the
logic of the program
• Flowcharts outline the general procedure

• Comparable to blueprint of a building


• draws a flowchart prior to writing a program
• standard flowchart symbols prescribed by the
American National Standard Institute (ANSI).
Multiplication by addition
4 x 200

200
200
200
200
Even/Odd number
Calculate factorial- 5! = 5*4*3*2*1
Computer languages
Natural languages are ambiguous, vaguely
structured (vs. well defined), and has very
large and ever changing (vs. well defined and
a stable set) vocabularies

• Machine language (Low level )


• Difficult to understand
• Assembly language (Low level )
• Symbolic instructions of executable machine codes
• High level language
• Some rules similar to spoken
Evolution
• Programming languages have evolved
tremendously
• hundreds of different languages
• user-friendly and more powerful
• five generations
First Generation: Machine/Native Language
• Binary- every instruction and data using 0/1
• Instruction consists of two parts
• Operation & Operand- where to find or store the
data (operation)
• Fast and efficient, executed directly on the CPU
• Difficult for humans to read, write, and debug
Evolution …
Second generation- Assembly Language
• Programs can be written symbolically, using English
words (also known as mnemonics)

LDA 10 copy the contents of location 10 into


the accumulator
ADD 11 add contents of location 11 to accumulator
ADD 12 add contents of location 12 to accumulator
STA 13 copy contents of accumulator into a location 13
STP stop - no more instructions
Assembler?
Evolution …
Third Generation
• High level, general-purpose
• FORTRAN, LISP, COBOL, ALGOL
• Ada, Basic, C, C++, Java, Pascal, Smalltalk

Easier for humans to read, write, debug


Compiler translates into machine code before
running
Interpreter translates into machine code at runtime
Evolution …
Fourth Generation
• Specification languages, query languages, report
generators, application generators
• Maple, Mathematica, Postscript, SPSS, SQL
Fifth Generation
• Solve problems using constraints rather than
algorithms, used in Artificial Intelligence
• Prolog
Assignments
IOA, IA, GA, Case !@#$
A = 10, B = 20, K = 5,
and SALES = 10000
A family tree of languages

Fortran Cobol
LISP

BASIC Algol 60
PL/1
Simula ML
Algol 68
C Pascal
Scheme
Smalltalk
Ada Dylan
C++ Perl
Modula 3 Prolog
Java
C# Python Ruby
History of Programming
Languages

Punch cards
Jacquard looms 1801?
Analytical engine
(Charles Babbage
and Ada Byron
Lovelace)
US Census data 1890
(Herman Hollerith)
Hand-coded machine
language programs
10110000 01100001
Assembly language
programs This portrait of Jacquard
mov ds,ax was woven in silk on a Jacquard
Modern programming loom and required 24,000
languages punched cards to create (1839)
Charles Babbage’s
Analytic Engine 1834

●Earliest known computer


●Never fully built
●Operations and variables on separate
punch cards
●Conditional jumps accomplished
mechanically by physically jumping over a
band of cards
● Babbage first computer scientist. Lady
Ada Byron first computer programmer.
Herman Hollerith Tabulator

Punch cards reader


Designed to tabulate
census data in 1890
Reduced census from
7 years to 3 years
for 63 M people
Electronic
Numerical
Integrator And
Computer 1946

●ENIAC was first general purpose digital computer


●Occupied about 1,800 square feet and used about
18,000 vacuum tubes, weighing almost 50 tons
●One thousand times faster than electro-
mechanical machines
Programming Language
Generations

Late 1940’s
Binary Code
Native computer language
Consists only of 0s and 1s
0’s = off
1’s = on
Difficult for humans to
read, write, and debug
Fast and efficient,
executed directly on the
CPU
Programming Language
Generations

How to code “Hello World” in Binary

01001000 01100101 01101100 01101100 01101111 = Hello


00100000 = Space
01110111 01101111 01110010 01101100 01100100 = World
Programming Language Generations
Early 1950’s

Assembly languages
Simple mnemonic instructions <opcode> <operands>
Assembler translates into machine code
Specific to each type of processor, not portable
Programming Language Generations

Code for adding two numbers in Assembly Language


.model small
.data
opr1 dw 1234h
opr2 dw 0002h
result dw 01 dup(?),'$'
.code
mov ax,@data
mov ds,ax
mov ax,opr1
mov bx,opr2
clc
add ax,bx
mov di,offset result
mov [di], ax
mov ah,09h
mov dx,offset result
int 21h
mov ah,4ch
int 21h
end
Programming Language Generations
Mid 1950’s - Present

High level, general-purpose


FORTRAN1950’s), LISP(1958), COBOL(1959), ALGOL, Basic
(1964), Ada, C(1972)

Easier for humans to read, write, debug


Portable – can be run on two or more kinds of processors
High level languages are handle in two ways
Compiler translates into machine code before running
Interpreter translates into machine code at runtime
Programming Language
Generations
Fortran
Among the earliest programming languages
Well-suited for mathematical calculations
Today used in some of the most demanding supercomputing
tasks
Weather and climate modeling
LISP
Created as a practical mathematical notation for computers
Link lists are one of Lisp language's major data structures
Favored programming language for artificial intelligence (AI)
research
COBOL
Popular for business data-processing on larger computers
Designed for use by Banks, utility companies, manufactures,
government agencies and other big companies.
Pascal
Named after mathematician, Blaise Pascal
Put into practice structured programming – easier to read, write,
debug
Programming Language Generations
Mid 1960’s - present

Object-Oriented Programming (OOP)


Simula(1960’s),Smalltalk(1970’s), C++(1980’s), C#, Eiffel, Java
(1990’s), Objective-C, C#, Pearl, Python, Ruby, PHP

Using Objects allowing programmers to write code independent


of specific application.
Designing modules of reusable software systems
Objects contain both data and functions
Easily used across multiple systems
Programming Language Generations
Specific Languages (1970’s – present)
Query languages, report generators, systems
engineering
Maple, Mathematica, Postscript, SPSS, SQL

Logic programming languages(1980s - ):


Solve problems using constraints rather than
algorithms, used in Artificial Intelligence
Prolog - natural language processing
Programming Language Generations
World Wide Web (1990 – present)
Internet languages allow everyday people to
access information stored on the web
HTML, JavaScript, PHP, Java, ASP, ASP.Net
HTML (Hyper Markup Language) is a basic language
for building web pages
JavaScript (1995) – Allows web pages to be
interactive
PHP is a general pupose language designed to
produce dynamic Web pages.
Programming Language industry uses
3.a Create a list of 10 popular programming languages in use today.
Language Industry Why is it used?
Java Most Widely used in industry
C All Very widely used
C++ Most Widely used in operating systems, desktop apps, developing
games, hardware drivers and much else.

C# Many Microsoft developed and in high demand


Objective-C Software Core of both of Apple's operating systems
PHP Web Server-side scripting language runs on more than 20 million
websites

Python Science,Business General purpose programming language


Entertainment

ASP.NET Web Microsoft server side Web development


Perl Web,Business, Dynamic programming language with may uses
Science

Javascript Web Make web pages interactive


HTML Web Primary language for internet
SQL Database Accessing structured databases

You might also like