Programming Languages

Содержание

Слайд 2

What You Will Learn About

What a programming language is
Machine language and assembly

What You Will Learn About What a programming language is Machine language
language
High-level programming languages
The shortcomings of early languages
Popular programming languages

Slide

Слайд 3

What You Will Learn About

The six phases of the program development life

What You Will Learn About The six phases of the program development
cycle (PDLC)
Why top-down programming makes programs easier to debug and maintain
The three basic types of control structures
Syntax errors and logic errors in programs

Slide

Слайд 4

Programming Languages

Programming languages are artificial languages created to tell the computer what

Programming Languages Programming languages are artificial languages created to tell the computer
to do
They consist of vocabulary and a set of rules to write programs
The program development life cycle (PDLC) is an organized method of software development

Slide

Machine Language

Ada

Pascal

Fortran

COBOL

Assembly Language

Smalltalk

Visual Basic

BASIC

Java

C and C++

Слайд 5

Development of Programming Languages

Programming languages are classified by levels or generations
Lower-level languages

Development of Programming Languages Programming languages are classified by levels or generations
are the oldest
The five generations of programming languages are:
Machine languages
Assembly languages
Procedural languages
Problem-oriented languages
Natural languages

Slide

Слайд 6

First-Generation Languages

Machine language:
Consists of binary numbers (0s and 1s)
Is the earliest

First-Generation Languages Machine language: Consists of binary numbers (0s and 1s) Is
programming language
Is the only language the computer understands without translation
Is machine dependent
Each family of processors has its own machine language

Slide

Слайд 7

Second-Generation Languages

Assembly language:
Resembles machine language
Is a low-level language
Uses brief abbreviations

Second-Generation Languages Assembly language: Resembles machine language Is a low-level language Uses
for program instructions.
Abbreviations are called mnemonics
A program is written in source code (text file) and translated into machine language by an assembler

Slide

Слайд 8

Third-Generation Languages

Procedural languages:
Are high-level languages that tell the computer what to

Third-Generation Languages Procedural languages: Are high-level languages that tell the computer what
do and how to do it
Create programs at a high level of abstraction
Are easier to read, write, and maintain than machine and assembly languages
Use a compiler or interpreter to translate code
Fortran and COBOL are third-generation languages

Slide

Слайд 9

Compilers and Interpreters

A compiler is a program that changes source code to

Compilers and Interpreters A compiler is a program that changes source code
object code
An interpreter translates source code one line at a time and executes the instruction

Slide

Слайд 10

Third-Generation Languages (continued)

Slide

Spaghetti Code and the Great Software Crisis:
GOTO statements resulted

Third-Generation Languages (continued) Slide Spaghetti Code and the Great Software Crisis: GOTO
in programs that were difficult to follow
This problem led to the software crisis of the 1960s
Programs were not ready on time
Programs exceeded their budgets
Programs contained too many errors
Customers were not satisfied

Слайд 11

Third-Generation Languages (continued)

Structured programming languages:
Were developed to improve software development
Include Algol and

Third-Generation Languages (continued) Structured programming languages: Were developed to improve software development
Pascal
Forbid the use of GOTO statements
Use control structures
IF-THEN-ELSE

Slide

Слайд 12

Third-Generation Languages (continued)

Modular programming languages:
Were developed because of problems in structured programming

Third-Generation Languages (continued) Modular programming languages: Were developed because of problems in
languages
Are used to create programs that are divided into separate modules
Each module carries out a special function
Require specified input to produce specified output

Slide

Слайд 13

Fourth-Generation Languages

Types of fourth-generation languages include:
Report generators
Languages for printing database reports
Query

Fourth-Generation Languages Types of fourth-generation languages include: Report generators Languages for printing
languages
Languages for getting information out of databases
Fourth-generation languages are nonprocedural
They do not force programmers to follow procedures to produce results

Slide

Слайд 14

Object-Oriented Programming

Object-oriented programming (OOP):
Relies on component reusability
The ability to produce program

Object-Oriented Programming Object-oriented programming (OOP): Relies on component reusability The ability to
modules that perform a specific task
Eliminates the distinction between programs and data
Uses objects that contain data and procedures

Slide

Слайд 15

Objects

Objects are units of information that contain data as well as methods

Objects Objects are units of information that contain data as well as
that process and manipulate the data
Classes of objects:
Hierarchy or category of objects
Objects at the top of the category are broader in scope than the subclass objects
Inheritance refers to an object’s capacity to “pass on” its characteristics to its subclasses

Slide

Слайд 16

Common Business-Oriented Language (COBOL)

COBOL:
The earliest (1959) high-level language
The most widely used business

Common Business-Oriented Language (COBOL) COBOL: The earliest (1959) high-level language The most
language
A proven way to do accounting, inventory, billing, and payroll
Requires programmers to explain what the program is doing at each step

Slide

Sample Cobol program

Слайд 17

Formula Translator (Fortran)

Fortran:
Began in the 1950s
Is suited to scientific, mathematical, and

Formula Translator (Fortran) Fortran: Began in the 1950s Is suited to scientific,
engineering applications
Is used to solve complex equations
Features simplicity, economy, and ease of use

Slide

Sample Fortran program

Слайд 18

Ada

Ada:
Named after Augusta Ada Byron
Incorporates modular programming
The required language for the U.S.

Ada Ada: Named after Augusta Ada Byron Incorporates modular programming The required
Defense Department
Suitable for control of real-time systems (missiles)

Slide

Sample Ada program

Слайд 19

Beginner’s All-Purpose Symbolic Instruction Code (BASIC)

BASIC:
An easy-to-use language available on personal

Beginner’s All-Purpose Symbolic Instruction Code (BASIC) BASIC: An easy-to-use language available on
computers
Widely taught in schools as a beginner’s programming language
Designed as an interpreted language

Slide

Sample BASIC program

Слайд 20

Visual Basic (VB)

Visual Basic:
Is widely used in program development packages
Uses event-driven

Visual Basic (VB) Visual Basic: Is widely used in program development packages
programming
Enables the programmer to develop an application by using on-screen graphical user interfaces

Slide

Sample Visual Basic

Слайд 21

Pascal

Pascal:
Is named after Blaise Pascal
Encourages programmers to write well-structured programs
Widely accepted as

Pascal Pascal: Is named after Blaise Pascal Encourages programmers to write well-structured
a teaching language
Has been updated to reflect new approaches to programming

Slide

Sample Pascal program

Слайд 22

C

C:
Was developed by AT&T’s Bell Labs in the 1970s
Combines high-level programming

C C: Was developed by AT&T’s Bell Labs in the 1970s Combines
language with assembly language
Programmers manipulate bits of data within a processing unit

Difficult to learn and programming is time consuming

Slide

Sample C program

Слайд 23

Smalltalk

Smalltalk:
Developed in the 1970s by Xerox Corp
“100% pure” object-oriented programming language
Not often

Smalltalk Smalltalk: Developed in the 1970s by Xerox Corp “100% pure” object-oriented
chosen for software development

Slide

Sample Smalltalk program

Слайд 24

C++

C++:
Incorporates object-oriented features
Is widely used for professional program development

Slide

Sample C++ program

C++ C++: Incorporates object-oriented features Is widely used for professional program development Slide Sample C++ program

Слайд 25

Java

Java:
Developed by Sun Microsystems
An object-oriented, high-level programming language with a twist
First true

Java Java: Developed by Sun Microsystems An object-oriented, high-level programming language with
cross-platform programming language
Gained acceptance faster than any other programming language
A simplified version of C++

Slide

Слайд 26

Java

Java, continued :
Java is designed to run on any computer platform
Java Virtual

Java Java, continued : Java is designed to run on any computer
Machine enables cross-platform use
Java applets or small programs are downloaded to computers through networks
Weaknesses include:
The security risk in downloading applets
The speed in running the programs

Slide

Слайд 27

Sample Java Program

Slide

Sample Java Program Slide

Слайд 28

Web-Based Languages

Markup languages:
Hypertext markup language (HTML) sets the attributes of text and

Web-Based Languages Markup languages: Hypertext markup language (HTML) sets the attributes of
objects within a Web page
Extensible markup language (XML) is used for sharing data and objects in a Web environment
Scripting languages:
VBScript is used to write short programs (scripts) that are embedded in Web pages
JavaScript is used to write scripts on Web pages
Visual Studio .NET:
Used for the development of scripts and programs that are accessible from the Web

Slide

Слайд 29

The Program Development Life Cycle (PDLC)

The PDLC was introduced in the 1970s

The Program Development Life Cycle (PDLC) The PDLC was introduced in the
to address problems in creating programs
It provides an organized plan for breaking down the task of program development into manageable parts
Six phases of the PDLC:
Defining the problem
Designing the program
Coding the program
Testing and debugging the program
Formalizing the solution
Implementing and maintaining the program

Slide

Слайд 30

Phase 1: Defining the Problem

The first step in program development
Systems analysts provide

Phase 1: Defining the Problem The first step in program development Systems
program specifications (specs) to programmers
Specs define:
Input data
Processing
Output
Appearance of user interface

Slide

Слайд 31

Phase 2: Designing the Program

Programmers create the program’s design
Top-down design focuses on

Phase 2: Designing the Program Programmers create the program’s design Top-down design
the program’s main goal (main routine), then breaks the program into manageable components (subroutines/modules)
Control structures are used to see how each subroutine will do its job
Developing an algorithm is a step-by-step description of how to arrive at a solution
Program design tools:
Structure charts – show the top-down design
Flow charts – show the logic of program
Pseudo code – alternative to flow charts

Slide

Слайд 32

Structured Design

Control structures are logical constructs that specify how the instructions in

Structured Design Control structures are logical constructs that specify how the instructions
a program are to be executed
Three types of control structures:
Sequence control structure – Instructions are executed in the order in which they appear
Selection control structures – The program branches to different instructions depending on whether a condition is met; IF…THEN…ELSE
Repetition control structure – The program repeats the same instructions over and over; DO-WHILE and DO-UNTIL

Slide

Слайд 33

Structure Chart and Flowchart

Slide

Structure Chart

Flowchart

Structure Chart and Flowchart Slide Structure Chart Flowchart

Слайд 34

Phase 3: Coding the Program

Coding requires the translation of the algorithm into

Phase 3: Coding the Program Coding requires the translation of the algorithm
specific program instructions
An appropriate programming language is chosen, and the code is typed according to its syntax rules

Slide

Слайд 35

Phase 4: Testing and Debugging the Program

Testing and debugging eliminate all errors
Syntax

Phase 4: Testing and Debugging the Program Testing and debugging eliminate all
and logic errors are corrected
Debugging is the process of eliminating errors

Slide

Слайд 36

Phase 5: Formalizing the Solution

Documentation is created for future use
The variable names

Phase 5: Formalizing the Solution Documentation is created for future use The
and definitions, a description of the files needed, and the layout of the output are produced
A user manual is developed to explain how the program works

Slide

Слайд 37

Phase 6: Implementing and Maintaining the Program

The program is:
Tested by users
Thoroughly documented
Maintained

Phase 6: Implementing and Maintaining the Program The program is: Tested by
and evaluated regularly

Slide

Слайд 38

Summary

A programming language is an artificial language consisting of a vocabulary and

Summary A programming language is an artificial language consisting of a vocabulary
a set of rules
Machine language is the lowest-level programming language
Assembly language contains symbols for programming instructions
Third-generation (high-level) languages require programmers to specify the procedures to be followed
Object-oriented languages combine procedures and data

Slide

Имя файла: Programming-Languages.pptx
Количество просмотров: 788
Количество скачиваний: 16