0% found this document useful (0 votes)
13 views38 pages

Morley Lec 5 Ict

Uploaded by

moizulhassan675
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views38 pages

Morley Lec 5 Ict

Uploaded by

moizulhassan675
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 38

Introduc)on

 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  

– Common  programming  languages  

© 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

• Object-­‐Oriented  Programming  (OOP)  


– Programs  consist  of  a  collec)on  of  objects  that  contain  
data  and  methods  to  be  used  with  that  data  
• Class  
– Group  of  objects  that  share  some  common  
proper)es,  example:  car  
• Instance  
– An  individual  object  in  a  class,  example:  Toyota  ,  
Yaris,  2014,  blue,  automa)c,  …  etc.  
• A\ributes  
– Data  about  the  state  of  an  object,  example:  
manufacturing  year  =  2013,  color  =  green  

© 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  

• The  Sequence  Control  


Structure  
– Series  of  statements  
that  follow  one  
another  

© 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

• The  Selec)on  Control  Structure  


– Mul)ple  paths,  direc)on  depends  on  result  of  a  
certain  condi)on  
» If-­‐then-­‐else  
– Case  control  structure    
» Allows  for  as  many  possible  
 results  of  the  specified    
condi)on  as  needed  

© 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

• Repe))on  Control  Structure  (itera)on  control  structure)  


– Repeat  series  of  steps  
– Condi)onal  Loops  
» Do-­‐while  
» Do-­‐un)l  
– Fixed  Itera)ons  
» For  loop  

© 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

– Program  Design  Tes)ng  


• Design  should  be  tested  to  ensure  logic  is  correct  
 
– Documenta)on:  Design  Specifica)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.
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

– Transla)ng  Coded  Programs  into  Executable  Code  


• Coded  programs  need  to  be  translated  from  source  
code  wri\en  by  the  programmer  to  object  code  the  
computer  can  execute  

• Converted  using  a  language  translator  


– Program  that  converts  source  code  to  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.
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

4)  Program  Debugging  and  Tes)ng  


– The  process  of  ensuring  a  program  is  free  of  errors  (bugs)  
and  works  as  it  is  supposed  to  
 

© 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

5)  Program  Implementa;on  and  Maintenance  


– Once  the  system  containing  the  program  is  up  and  
running,  the  implementa)on  process  is  complete  
– Program  maintenance  
• Process  of  upda)ng  sobware  so  it  con)nues  to  be  
useful  
• Very  costly  
– Documenta)on:    Amended  program  package  
• Program  package  should  be  updated  to  reflect  new  
problems  or  issues  that  occur  and  what  changes  to  the  
program  were  necessary  

© 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

• What  is  a  Programming  Language?  


– A  set  of  rules,  words,  symbols,  and  codes  used  to  write  
computer  programs  

– To  write  a  program,  appropriate  sobware  for  the  


programming  language  being  used  is  needed  

© 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

• Categories  of  Programming  Languages  


1)  Low-­‐Level  Languages  (earliest  programming  languages)  
• Machine  language  
– Wri\en  at  a  very  low  level,  just  using  1s  and  0s  
– First  genera)on  of  programming  languages  
• Assembly  language  
– Includes  some  names  and  other  symbols  to  replace  
some  of  the  1s  and  0s  in  machine  language  
– Second    genera)on  of  programming  languages  
– Machine  dependent  
» Wri\en  for  one  specific  type  of  computer  
© 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.
26
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - 3

© 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

3)  Fourth-­‐Genera)on  Languages  (4GLs)  


• Even  closer  to  natural  languages  and  easier  to  work  
with  than  high-­‐level  
• Declara)ve  rather  than  procedural  
• Includes  structured  query  language  (SQL)  used  with  
databases  
• Common  Programming  Languages  
– Languages  not  widely  used  today  
• Logo  (teach  children  how  to  program)  
• PL/1  (business  and  scien)fic  applica)ons  
• Prolog  and  LISP  (ar)ficial  intelligence)  
• SmallTalk  (one  of  the  first  object-­‐oriented  languages)  
 
© 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.
30
May not be scanned, copied, duplicated, or posted to a publicly accessible website, in whole or in part.
Programming Languages - Fortran

– 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  

– BASIC  and  Visual  Basic  


• Easy-­‐to-­‐learn,  high-­‐level  programming  language  that  
was  developed  to  be  used  by  beginning  programmers  
• Visual  Basic  
– Object-­‐oriented  version  of  BASIC;  uses  a  visual  
environment  

© 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,  C++,  and  C#  


• C  
– Designed  for  system  programming  

• 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  

• Can  run  on  any  computer  that  includes  Java  Virtual  


Machine  (Java  VM)  

• Is  one  of  the  most  popular  programming  languages  


today  

© 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.

You might also like