Programming Languages - PowerPoint PPT Presentation

1 / 23
About This Presentation
Title:

Programming Languages

Description:

As seen in the lecture on algorithms, a program is a very precise algorithm that ... op-codes are given an English mnemonic (memory aid) ... – PowerPoint PPT presentation

Number of Views:1074
Avg rating:3.0/5.0
Slides: 24
Provided by: asia80
Category:

less

Transcript and Presenter's Notes

Title: Programming Languages


1
Programming Languages
  • An interesting history of software can be found
    on
  • History of Computing Software Index

2
From Algorithm to Program
  • A program is an algorithm
  • As seen in the lecture on algorithms, a program
    is a very precise algorithm that is written in
    primitives
  • We know that programs have several levels the
    lowest being machine code.

3
Generations of Languages
  • Machine Language, 1st generation
  • Assembler, 2nd generation
  • High level languages, 3rd generation

4
1st Generation Programming Language was Machine
code
  • Suppose you were given the following list of
    instructions to perform
  • 0001 0011 0011 1011
  • 1101 0111 0001 1001
  • 1111 0001 1101 1111
  • 0000 1100 0101 1101
  • 0001 0011 0011 1011
  • it is extremely confusing for a computer
    programmer

5
2nd Generation Programming language was Assembler
language
  • Program from the Virginia Tech Courseware
  • LOAD   5
  • STORE  15
  • EQUAL  15
  • JUMP   6
  • HALT
  • ADD    1
  • JUMP   3

6
2nd Generation Programming languages were machine
oriented
  • op-codes are given an English mnemonic (memory
    aid)
  • Second thing, not shown in courseware is
    symbolic addressing

7
2nd generation programming languages were machine
oriented.
  • In order to write a program the programmer had to
    have a basic understanding of the machine to use
    instructions such as load, store, etc.
  • Must understand that math can only be done in the
    ALU

8
The 3rd Generation programming languages started
with FORTRAN
  • FORTRAN was invented in the early 1950s and was a
    scientific language
  • FORTRAN Stood for FORmula TRANslation
  • Developed by a team headed by John Backus
  • In the 1950s most computers were used for
    scientific purpose since they were too expensive
    for businesses

9
Example of a FORTRAN program
  • Remember our Assembler language program
  • LOAD   2
  • STORE  13
  • LOAD   5
  • STORE  14
  • LOAD   13
  • ADD    14
  • STORE  15
  • HALT

10
In FORTRAN this program would be
  • x 2
  • y 5
  • Z x y
  • Note that the programmer does not have to know
    about load and store operations etc.

11
First business language was COBOL Common Business
Oriented Language
  • Was developed by the US Department of Defense and
    first version was around 1960
  • Rear Admiral Dr. Grace Murray Hopper was the
    project leader
  • Why did the military need a business language?

12
COBOL Why the military?
  • Who has one the biggest payrolls to pay?
  • Who purchases millions of of equipment?
  • Who has one of the biggest inventories?

13
COBOL
  • Since business computing is more data processing
    oriented relater than calculation oriented the
    language is very poor at formulas but can define
    data in many different ways.
  • The language uses English like statements to
    define the program.
  • The example that we had in FORTRAN would be
    written Add X to Y giving Z.

14
Newer languages
  • Programming languages have come a long way since
    the 1960s. Today you would possible use Java,
    Visual Basic. C, etc.
  • There are hundreds of programming languages
    available today. An interesting list of languages
    can be found on the following hyperlink The
    Programming Languages Index

15
Five basic concepts of a 3rd generation
Programming language
  • variables
  • expressions
  • control structures
  • input/output
  • abstraction

16
Identifiers Constants and Variables
  • Identifiers are descriptive names that are mapped
    to locations in the computer's memory (RAM
    location)
  • Once a memory locals has a name it is easier to
    locate (do not have to remember the RAM address)
  • There are two types of Identifiers, they are,
    Variables and constants

17
Variables
  • a named memory location
  • value can change while a program is running
  • allows data to be stored in computer memory

18
Constant
  • a named value
  • value always remains the same while a program is
    running
  • allows programs to be easily modified

19
Assigment
  • C and Java
  • PriceOfShoes 19.95
  • Pascal
  • TAXRATE 0.045

20
Expression
  • result 6 10 / 2 - 4 2
  • Order of operations
  • result (6 10) / 2 - 4 2

21
Control Structures
  • Sequence
  • Selection (If and Else)
  • Loop
  • Subprograms

22
Input/output
  • two types of I/O
  • User I/O is interactive since this type of input
    is generally accomplished via the keyboard or
    mouse and a monitor.
  • File I/O allows us to store data in a file on the
    computer and then read the data from this file

23
Now go to the courseware using the below
hyperlink and review the topic
  • Online CS Modules Programming Languages
Write a Comment
User Comments (0)
About PowerShow.com