SlideShare a Scribd company logo
Data Structures and Algorithms




    Pointers for
    Structuring a
    Program

  1. Use Modules
  2. Use the four logic structures
              a.    Sequential Structure
              b.    Decision Structure
              c.    Loop Structure
              d.    Case Structure

  3. Eliminate the rewriting of identical processes by
     using modules
  4. Use techniques to improve readability, including
     the four logic structures, proper naming of
     variables, internal documentation, and proper
     indentation




Introduction to Programming Structure                     *Property of STI
                                                             Page 1 of 11
Data Structures and Algorithms




        Cohesion and
        Coupling


Cohesion
   @ relates to the functional independence of the
        module and to the performance of a single “task”
        within the module

Coupling
   @ allows modules to be connected by an interface,
        which enables the programmer to transfer data
        from one module to another.




Introduction to Programming Structure                   *Property of STI
                                                           Page 2 of 11
Data Structures and Algorithms




       Modules



Rules in Designing Modules
 1. Each module is an entity itself.
 2. Each module has a single function.
 3. Each module is short enough to be easily read and
    modified.
 4. The length of a module is governed by its function
    and the number of instructions to be executed to
    perform that function.
 5. A module is developed to control the order of
    processing.




Introduction to Programming Structure                  *Property of STI
                                                          Page 3 of 11
Data Structures and Algorithms




       Modules



              Types of Modules
                1. Control Module
                2. Initialization Module
                3. Process Data Module
                   a. Calculation Modules
                   b. Print Modules
                   c. Read and Data Validation Modules
                4. Wrap-up module
                5. Event Modules (OO-Paradigm)




Introduction to Programming Structure                      *Property of STI
                                                              Page 4 of 11
Data Structures and Algorithms




   Local and Global
   Variables
Local Variables
@     may be used only by the module itself

Global Variables
@ they are global to the program as they can be seen by
     all modules




Introduction to Programming Structure                        *Property of STI
                                                                Page 5 of 11
Data Structures and Algorithms




    Parameters

Parameters
  @ local variables that are passed or sent from one
        module to another. Parameters are another way
        of facilitating coupling that allows the
        communication of data between modules

Calling Module
  @ the module that processes another module

Called Module
  @ the module being processed




Introduction to Programming Structure                  *Property of STI
                                                          Page 6 of 11
Data Structures and Algorithms




    Parameters


Actual parameter listing
    @       the list of parameters that follows the module
            name being processed in the calling module

Formal Parameter Listing
    @       the list of parameters that follow the module
            name at the beginning of the module




Introduction to Programming Structure                     *Property of STI
                                                             Page 7 of 11
Data Structures and Algorithms




    Parameters




                        Types of parameter passing
                            a Call by value
                            a Call by reference




Introduction to Programming Structure                            *Property of STI
                                                                    Page 8 of 11
Data Structures and Algorithms




    Parameters




Introduction to Programming Structure                  *Property of STI
                                                          Page 9 of 11
Data Structures and Algorithms




    Parameters




Introduction to Programming Structure                  *Property of STI
                                                         Page 10 of 11
Data Structures and Algorithms




     Variable Names
     and Data
     Dictionary




       The Four Logic Structures
           •   Sequential
           •   Decision
           •   Loop
           •   Case


Introduction to Programming Structure                  *Property of STI
                                                         Page 11 of 11

More Related Content

PPTX
Sql Functions And Procedures
PPTX
Entity relationship diagram - Concept on normalization
PPTX
Gof design patterns
PDF
01-Database Administration and Management.pdf
PPTX
OOP - Benefits and advantages of OOP
DOCX
Software engineering Questions and Answers
PPT
Sql joins
Sql Functions And Procedures
Entity relationship diagram - Concept on normalization
Gof design patterns
01-Database Administration and Management.pdf
OOP - Benefits and advantages of OOP
Software engineering Questions and Answers
Sql joins

What's hot (20)

PPTX
2.software requirement specification
PDF
R Programming: Introduction to Matrices
PDF
Unified Modeling Language
PPTX
Functional point analysis
PPTX
Software engineering.pptx
PPT
Dwh lecture 07-denormalization
PPTX
Architectural design model
PDF
Loops in Visual Basic: Exercises
PPT
Database design
PPT
Formal Specification in Software Engineering SE9
PDF
Syllabus T.Y.Bsc. I.T. (SEM V & SEM VI)
PDF
Object oriented concepts ppt
PPTX
Data Manipulation Language
PPT
PPTX
Presentation on python
PPTX
Ch16 component based software engineering
PPT
Spiral model presentation
PPTX
Theory of programming
PPT
System Analysis and Design
PPT
Cs8592 ooad unit 3
2.software requirement specification
R Programming: Introduction to Matrices
Unified Modeling Language
Functional point analysis
Software engineering.pptx
Dwh lecture 07-denormalization
Architectural design model
Loops in Visual Basic: Exercises
Database design
Formal Specification in Software Engineering SE9
Syllabus T.Y.Bsc. I.T. (SEM V & SEM VI)
Object oriented concepts ppt
Data Manipulation Language
Presentation on python
Ch16 component based software engineering
Spiral model presentation
Theory of programming
System Analysis and Design
Cs8592 ooad unit 3
Ad

Viewers also liked (20)

PPTX
structured programming
PPT
PPT
Bab 1b The Structure Of A Computer Program
PPTX
(Aug.31) introduction to macflash
PPTX
Introduction to basic programming repetition
PPTX
Functions in C++
PDF
CS4109 Computer System Architecture
PPTX
High-level languages for Big Data Analytics (Presentation)
PPTX
Programming languages,compiler,interpreter,softwares
PPT
Computer languages
PPT
Lecture 8
PPT
Top down design
PDF
5 structured programming
PPT
Programming languages
PPTX
High Level Languages (Imperative, Object Orientated, Declarative)
PPT
Computer hardware component Created by king parmeshwar pawar
PPTX
My presentation on 'computer hardware component' {hardware}
PPTX
High Level Language (HLL)
PPT
FUNCTIONS IN c++ PPT
PPTX
Top down process
structured programming
Bab 1b The Structure Of A Computer Program
(Aug.31) introduction to macflash
Introduction to basic programming repetition
Functions in C++
CS4109 Computer System Architecture
High-level languages for Big Data Analytics (Presentation)
Programming languages,compiler,interpreter,softwares
Computer languages
Lecture 8
Top down design
5 structured programming
Programming languages
High Level Languages (Imperative, Object Orientated, Declarative)
Computer hardware component Created by king parmeshwar pawar
My presentation on 'computer hardware component' {hardware}
High Level Language (HLL)
FUNCTIONS IN c++ PPT
Top down process
Ad

Similar to 4 introduction to programming structure (20)

PDF
3 programming concepts
PDF
10 data structures
PPTX
Algorithm and Data Structures - Basic of IT Problem Solving
PPTX
Data Structure.pptx
PPS
01 ds and algorithm session_01
PPS
01 ds and algorithm session_01
PDF
Data Structure Introduction.pdfssssssssssss
PPT
1.1 introduction to Data Structures.ppt
PPT
The Stack in Data structure and algorithm
PDF
Structures in c++
PPT
Data Structures
PDF
Chapter 1 Introduction to Data Structures and Algorithms.pdf
PDF
A REVIEW DATA STRUCTURE , ALGORITHMS & ANALYSIS
PPTX
Lecture 01 Intro to DSA
PPTX
EE-232-LEC-01 Data_structures.pptx
PPTX
Lec1_introductionLec1_introductionokkokokok
PPTX
Summer Training Project On Data Structure & Algorithms
PDF
01VD062009003760042.pdf
PPT
part 1 - intorduction data structure 2021 mte.ppt
PPTX
DATA STRUCTURE AND COMPUTER ALGORITHMS LECTURE 1
3 programming concepts
10 data structures
Algorithm and Data Structures - Basic of IT Problem Solving
Data Structure.pptx
01 ds and algorithm session_01
01 ds and algorithm session_01
Data Structure Introduction.pdfssssssssssss
1.1 introduction to Data Structures.ppt
The Stack in Data structure and algorithm
Structures in c++
Data Structures
Chapter 1 Introduction to Data Structures and Algorithms.pdf
A REVIEW DATA STRUCTURE , ALGORITHMS & ANALYSIS
Lecture 01 Intro to DSA
EE-232-LEC-01 Data_structures.pptx
Lec1_introductionLec1_introductionokkokokok
Summer Training Project On Data Structure & Algorithms
01VD062009003760042.pdf
part 1 - intorduction data structure 2021 mte.ppt
DATA STRUCTURE AND COMPUTER ALGORITHMS LECTURE 1

More from Rheigh Henley Calderon (20)

PDF
9 processing arrays
PDF
8 problem solving with the case logic structure
PDF
7 problem solving with loops
PDF
6 problem solving with decisions
PDF
5 problem solving with the sequential logic structure
PDF
2 beginning problem solving concepts for the computer
PDF
1 introduction to problem solving and programming
PPTX
9 technical support
PPTX
8 customer service
PPTX
7 laptop repair
PPTX
6 laptop basics
PPTX
5 pc maintenance
PPTX
PPTX
PPTX
2 pc assembly
PPTX
1 hardware fundamentals
PPTX
8 cyber crimes
PPTX
7 computer ethics
PPTX
6 professional ethics
PPTX
5 business ethics
9 processing arrays
8 problem solving with the case logic structure
7 problem solving with loops
6 problem solving with decisions
5 problem solving with the sequential logic structure
2 beginning problem solving concepts for the computer
1 introduction to problem solving and programming
9 technical support
8 customer service
7 laptop repair
6 laptop basics
5 pc maintenance
2 pc assembly
1 hardware fundamentals
8 cyber crimes
7 computer ethics
6 professional ethics
5 business ethics

Recently uploaded (20)

PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Big Data Technologies - Introduction.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
cuic standard and advanced reporting.pdf
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Approach and Philosophy of On baking technology
PPT
Teaching material agriculture food technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
KodekX | Application Modernization Development
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
A Presentation on Artificial Intelligence
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Big Data Technologies - Introduction.pptx
Chapter 3 Spatial Domain Image Processing.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Building Integrated photovoltaic BIPV_UPV.pdf
Encapsulation_ Review paper, used for researhc scholars
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
“AI and Expert System Decision Support & Business Intelligence Systems”
cuic standard and advanced reporting.pdf
The Rise and Fall of 3GPP – Time for a Sabbatical?
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
The AUB Centre for AI in Media Proposal.docx
Advanced methodologies resolving dimensionality complications for autism neur...
Approach and Philosophy of On baking technology
Teaching material agriculture food technology
Understanding_Digital_Forensics_Presentation.pptx
KodekX | Application Modernization Development
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
A Presentation on Artificial Intelligence

4 introduction to programming structure

  • 1. Data Structures and Algorithms Pointers for Structuring a Program 1. Use Modules 2. Use the four logic structures a. Sequential Structure b. Decision Structure c. Loop Structure d. Case Structure 3. Eliminate the rewriting of identical processes by using modules 4. Use techniques to improve readability, including the four logic structures, proper naming of variables, internal documentation, and proper indentation Introduction to Programming Structure *Property of STI Page 1 of 11
  • 2. Data Structures and Algorithms Cohesion and Coupling Cohesion @ relates to the functional independence of the module and to the performance of a single “task” within the module Coupling @ allows modules to be connected by an interface, which enables the programmer to transfer data from one module to another. Introduction to Programming Structure *Property of STI Page 2 of 11
  • 3. Data Structures and Algorithms Modules Rules in Designing Modules 1. Each module is an entity itself. 2. Each module has a single function. 3. Each module is short enough to be easily read and modified. 4. The length of a module is governed by its function and the number of instructions to be executed to perform that function. 5. A module is developed to control the order of processing. Introduction to Programming Structure *Property of STI Page 3 of 11
  • 4. Data Structures and Algorithms Modules Types of Modules 1. Control Module 2. Initialization Module 3. Process Data Module a. Calculation Modules b. Print Modules c. Read and Data Validation Modules 4. Wrap-up module 5. Event Modules (OO-Paradigm) Introduction to Programming Structure *Property of STI Page 4 of 11
  • 5. Data Structures and Algorithms Local and Global Variables Local Variables @ may be used only by the module itself Global Variables @ they are global to the program as they can be seen by all modules Introduction to Programming Structure *Property of STI Page 5 of 11
  • 6. Data Structures and Algorithms Parameters Parameters @ local variables that are passed or sent from one module to another. Parameters are another way of facilitating coupling that allows the communication of data between modules Calling Module @ the module that processes another module Called Module @ the module being processed Introduction to Programming Structure *Property of STI Page 6 of 11
  • 7. Data Structures and Algorithms Parameters Actual parameter listing @ the list of parameters that follows the module name being processed in the calling module Formal Parameter Listing @ the list of parameters that follow the module name at the beginning of the module Introduction to Programming Structure *Property of STI Page 7 of 11
  • 8. Data Structures and Algorithms Parameters Types of parameter passing a Call by value a Call by reference Introduction to Programming Structure *Property of STI Page 8 of 11
  • 9. Data Structures and Algorithms Parameters Introduction to Programming Structure *Property of STI Page 9 of 11
  • 10. Data Structures and Algorithms Parameters Introduction to Programming Structure *Property of STI Page 10 of 11
  • 11. Data Structures and Algorithms Variable Names and Data Dictionary The Four Logic Structures • Sequential • Decision • Loop • Case Introduction to Programming Structure *Property of STI Page 11 of 11