Morley Lec 5 Ict
Morley Lec 5 Ict
to
Computer
CC111
Week
05
Program
Development
and
Flowchart
1
– The
phases
of
the
program
development
life
cycle
(PDLC)
– Tools that can be used to design and develop a program
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
2
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Approaches to Design and Development
• Procedural
Programming
– An
approach
to
program
design
in
which
a
program
is
separated
into
small
modules
that
are
called
by
the
main
program
or
another
module
when
needed
• Procedure
call—loca)ng
specific
tasks
in
procedures
(modules
or
subprograms)
that
are
called
by
the
main
program
when
needed
• Allows
each
procedure
to
be
performed
as
many
)mes
as
needed;
mul)ple
copies
of
code
not
needed
• Prior
to
procedural
programming,
programs
were
one
large
set
of
instruc)ons
(used
GOTO
statements)
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
3
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Approaches to Design and Development
• Structured
Programming
– Goes
even
further,
breaking
the
program
or
procedures
into
small
blocks
of
three
control
structures
(Top-‐down
design):
1)
sequence
of
statements
(procedures);
2)
selec)on
(if
and
switch-‐case
statements);
3)
and
itera)ons
(for
and
while
loops).
– Variables
• Named
memory
loca)ons
that
are
defined
for
a
program
•
Used
to
store
the
current
value
of
data
items
used
in
the
program
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
4
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Approaches to Design and Development
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
5
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Approaches to Design and Development
• Methods
– Perform
ac)ons
on
an
object
• Objects
can
perform
nontradi)onal
ac)ons
and
be
easily
used
by
more
than
one
program.
Example
the
open
file
bu\on
is
used
in
the
Office
Word,
and
in
the
Office
Power
point,
and
many
other
programs.
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
6
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
The Program Development Life Cycle (PDLC)
• Program
Development
Life
Cycle
(PDLC)
– The
five
phases
of
program
development
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
7
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
PDLC – Analysis Phase
1)
Problem
Analysis
– The
problem
is
considered
and
the
program
specifica)ons
are
developed
• Specifica)ons
developed
during
the
PDLC
are
reviewed
by
the
systems
analyst
(the
person
who
analyze
the
problem)
and
the
programmer
(the
person
who
will
code
the
program)
• Goal
is
to
understand
the
func)ons
the
sobware
must
perform
– Documenta)on:
Program
Specifica)ons
• Result
of
the
first
phase
of
the
PDLC
outlining
what
the
program
must
do
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
8
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
PDLC – Design Phase - I
2)
Program
Design
– The
program
specifica)ons
are
expanded
into
a
complete
design
of
the
new
program
• Algorithm
for
the
program
is
developed
• Careful
planning
and
design
of
a
computer
program
are
extremely
important
– Program
Design
Tools
• Pseudo-‐code
– Uses
English-‐like
statements
to
outline
the
logic
of
a
program
rather
than
the
flowchart’s
graphical
symbols
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
9
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Pseudo-code Example: Directions For
Computers
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
10
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Flowcharts
• Flowcharts
– Show
graphically,
step-‐by-‐step,
how
a
computer
program
will
process
data
– Use
special
symbols
and
rela)onal
operators
– Can
be
drawn
by
hand
or
with
flowchar)ng
sobware
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
11
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Flowcharts Example
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
12
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Sequence of Statements
– Control
Structures
• A
pa\ern
for
controlling
the
flow
of
logic
in
a
computer
program
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
13
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Selection Control Structure
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
14
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Iterations
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
15
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
PDLC – Design Phase - II
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
16
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
PDLC: Implementation Phase - I
3)
Program
Coding
– The
program
code
is
wri\en
using
a
programming
language
– Choosing
a
Programming
Language
• Suitability
to
the
applica)on
• Integra)on
with
other
programs
• Programmer
availability
• Portability
if
being
run
on
mul)ple
plaforms
• Development
speed
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
17
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
PDLC: Implementation Phase - II
– Reusable
code
• Pretested,
error-‐free
code
segments
that
can
be
used
over
and
over
again
with
minor
modifica)ons
• Can
greatly
reduce
development
)me
– Documenta)on:
Documented
Source
Code
• Program
coding
phase
results
in
the
program
wri\en
in
the
desired
programming
language
• Should
include
enough
comments
(internal
documenta)on)
so
that
the
source
code
is
easy
to
understand
and
update
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
18
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
PDLC: Implementation Phase - III
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
19
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
PDLC: Implementation Phase - IV
– Compilers
• Language
translator
that
converts
an
en)re
program
into
machine
language
before
execu)ng
it
– Interpreters
• Translates
and
executes
one
line
of
code
at
one
)me
– Assemblers
• Convert
assembly
language
programs
into
machine
language
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
20
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
PDLC – Testing Phase - I
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
21
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
PDLC – Testing Phase - II
– Preliminary
Debugging
• Compiler
and
Syntax
Errors
– As
programs
are
compiled
or
interpreted,
errors
occur
which
prevent
the
program
from
running
properly
− Syntax
errors
occur
when
the
programmer
has
not
followed
the
rules
of
the
programming
language
• Run
Time
– Run
)me
errors
occur
when
the
program
is
running,
examples:
failure
to
read
a
file
or
user
input.
• Logic
errors
are
errors
in
the
logic
of
the
program
– Program
will
run
but
produces
incorrect
results
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
22
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
PDLC – Testing Phase - III
– Tes)ng
• Occurs
aber
the
program
appears
to
be
correct
to
find
any
addi)onal
errors
• Uses
good
test
data—data
that
is
very
similar
to
the
actual
data
that
will
be
used
in
the
program
• Tests
condi)ons
that
will
occur
when
the
program
is
implemented
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
23
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
PDLC: Maintenance Phase
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
24
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - 1
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
25
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - 2
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
27
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - 4
2)
High-‐Level
Languages
• Closer
to
natural
languages
• Machine
independent
• Includes
3GLs
(FORTRAN,
BASIC,
COBOL,C,
etc.)
and
object-‐oriented
languages
(Visual
Basic,
C#,
Python,
Java,
etc.)
• Visual
or
graphical
languages
– Use
graphical
interface
to
create
programs
– Designed
for
educa)onal
purposes
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
28
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - 5
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
29
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - 6
– FORTRAN
• High-‐level
programming
language
used
for
mathema)cal,
scien)fic,
and
engineering
applica)ons
• Efficient
for
math,
engineering
and
scien)fic
applica)ons
• S)ll
used
today
for
high-‐performance
compu)ng
tasks
(weather
forecas)ng)
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
31
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - 7
– Pascal
• Named
aber
mathema)cian
Blaise
Pascal
• Created
as
a
teaching
tool
to
encourage
structured
programming
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
32
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - Pascal
Pascal
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
33
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - Basic
Basic
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
34
Programming Languages - 8
• C++
– Object-‐oriented
versions
of
C
– Very
popular
for
graphical
applica)ons
• C#
(C
sharp)
– Used
to
create
Web
applica)ons
and
XML-‐based
Web
services
• Objec)ve-‐C:
– For
iPhone
and
other
Apple
applica)ons
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
35
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages – C
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
36
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - 9
– Java
• High-‐level,
object-‐oriented
programming
language
frequently
used
for
Web-‐based
applica)ons
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
37
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - Java
© 2013 Cengage Learning. All Rights Reserved. This edition is intended for use outside of the U.S. only, with content that may be different from the U.S. Edition.
38
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.