Lecture 1

Reading: Textbook Chapter 1


Contents:

What is a program and why develop program?

What is a programming language?

Brief introduction of a system development life cycle

Steps in program development

Writing, editing, compiling and linking program

Program execution

 


What is a program?

Why develop program?

 


What is a programming language?

 


Brief introduction of a system development life cycle

fig. 1-11

1-11.gif (7474 bytes)


Steps in program development

fig. 1-12

1-12.gif (24212 bytes)

 

Pseudocode example:

to calculate the number of male and female students by reading a file:

set maleCount to 0
set femaleCount to 0
read the first record from the student file
while not end of file
       if the gender of the student is male
             add 1 to maleCount
       else
             add 1 to femaleCount
       read the next record from the student file
output the maleCount
output the femaleCount

 

 

  • Flowchart: similar to pseudocode except that diagrams are used to indicate the flow.
  • fig. 1-13

    1-13.gif (13567 bytes)

     


    Writing, editing, compiling and linking program

    fig. 1-9

    1-9.gif (19163 bytes)


    Program execution

    fig. 1-10

    1-10.gif (17631 bytes)

    - End of Lecture 1-