Académique Documents
Professionnel Documents
Culture Documents
By
Dr. Ahmed Taha
Lecturer, Computer Science Department,
Faculty of Computers & Informatics,
Benha University
1
LOGO
LOGO
Book Title:
New Perspectives on Computer Concepts,
2014, Comprehensive
Authors:
June Jamrich Parsons, Dan Oja
Publisher:
Course Technology;
Edition:
16 edition (January 30, 2013)
LOGO
Book Contents
#
Chapter Title
Computer Hardware
Computer Software
The Internet
Digital Media
10
11
Databases
12
Computer Programming
LOGO
Computer Programming
Contents
1
Programming Basics
Programming Paradigms
Programming Tools
7
LOGO
Programming
Basics
LOGO
Computer Program
A Computer program, is
series of instructions that tells
a computer how to carry out
processing tasks.
LOGO
Computer Programming
Computer programming is
the craft of writing useful,
maintainable, and extensible
source code which can be
interpreted or compiled by a
computing system to perform
a meaningful task.
Programming a computer can be performed in one of
numerous languages, ranging from a higher-level language
to writing directly in low-level machine code.
10
LOGO
LOGO
12
LOGO
Programming Languages
A programming language is a set of keywords and
grammar rules designed for creating instructions that a
computer can ultimately process or carry out.
Computer programs can be compiled or interpreted.
A keyword, or command, is a word with a predefined
meaning for the compiler or interpreter that translates each
line of program code into machine language.
13
LOGO
Programming Languages
An instruction for a computer program consists of keywords
and parameters, formed into sentence-like statements
according to a set of syntax rules.
LOGO
Programming Languages
Classes
15
LOGO
Low-level Languages
High-level Languages
16
LOGO
LDA 5
STA Num1
LDA 4
ADD Num1
STA Total
END
Total:=5+4
17
LOGO
Programming Languages
Generations
18
LOGO
5th generation
Natural language
4th generation
2nd generation
1st generation
Assembly language
Machine language
19
LOGO
20
LOGO
LOGO
Examples:
COBOL and Fortran, were used extensively for business and scientific
applications
Pascal and BASIC were popular teaching languages
C and C++ remain popular today for system and application software
development
Objective-C is the programming language used to develop iPhone and iPad apps
Java is used for Android apps.
22
LOGO
23
LOGO
24
LOGO
25
LOGO
Description
Ada
Alice
BASIC
Visual Basic
C
Pascal
26
LOGO
Description
Java
JavaScript
LISP
Prolog
COBOL
Fortran
Visual Basic
27
LOGO
Programming Paradigms
28
LOGO
Programming Paradigm
Programming paradigm refers to a way of conceptualizing
and structuring the tasks a computer performs.
Some programming languages support a single paradigm.
29
LOGO
Programming Paradigm
Paradigm
Languages
Description
Event-driven
Visual Basic, C#
Procedural
Objectoriented
Declarative
Prolog
30
LOGO
Program Development
Life Cycle
31
LOGO
Design the
program
Formalize the
solution
Code the
program
Test and debug
the program
32
LOGO
33
LOGO
34
LOGO
35
LOGO
Program Design
36
LOGO
Program Design
In general, an algorithm is a set of steps for carrying out a
task that can be written down and implemented
An algorithm for a computer program is a set of steps that
explains how to begin with known information specified in a
problem statement and how to manipulate that information
to arrive at a solution.
Algorithms are usually written in a format that is not specific
to a particular programming language.
The most well-known methods used to write an algorithm
are: structured English, pseudocode, and flowcharts
37
LOGO
Program Design
Structured English is a subset of the English language
with a limited selection of sentence structures that reflect
processing activities.
Pseudocode is a notational system for algorithms that has
been described as a mixture of English and your favorite
programming language.
Flowchart is a graphical representation of the way a
computer should progress from one instruction to the next
when it performs a task.
38
LOGO
Program Design
Structured English
39
LOGO
Program Design
Pseudocode
40
LOGO
Program Design
Flowchart
41
LOGO
Program Design
Flowchart
42
LOGO
Program Coding
43
LOGO
Program Coding
The process of coding a computer program depends on:
The programming language you use
The programming tools you select
The programming paradigm that best fits the problem youre trying
to solve.
44
LOGO
Program Coding
A text editor is any word processor that can be used for
basic text editing tasks, such as writing e-mail, creating
documents, or coding computer programs. (Ex: Notepad ).
A program editor is a type of text editor specially designed
for entering code for computer programs. Features vary, but
can include helpful programming aids, such as keyword
colorizing, word completion, keyboard macros, and search/
replace.
45
LOGO
Program Coding
46
LOGO
Program Coding
A program editor (bottom) offers tools more targeted to programmers.
47
LOGO
Program Coding
A VDE (visual development
environment) provides
programmers with tools to build
substantial sections of a program
by pointing and clicking rather
than typing lines of code.
A typical VDE is based on a form
design grid that a programmer
manipulates to design the user
interface for a program
48
LOGO
Program Coding
VDE
49
LOGO
50
LOGO
Syntax errors
Error types
Runtime errors
Logic errors
LOGO
52
LOGO
Programming Tools
53
LOGO
Programming Tools
Some programmers like to obtain programming tools a la
carte by picking up a compiler from one Web site, selecting
an interactive debugger from another Web site, and using
any handy editor, such as Notepad.
54
LOGO
Programming Tools
An SDK (software development kit) is a collection of
language-specific programming tools that enables a
programmer to develop applications for a specific computer
platform, such as Windows PCs.
55
LOGO
Programming Tools
An IDE (integrated development environment) is a type of
SDK that packages a set of development tools into a
smooth programming application.
The modules in the applicationeditor, compiler, debugger,
and user interface development toolhave a uniform set of
menus and controls, which simplifies the programming
process.
56
LOGO
57