• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
4 introduction to programming structure
 

4 introduction to programming structure

on

  • 1,901 views

 

Statistics

Views

Total Views
1,901
Views on SlideShare
1,900
Embed Views
1

Actions

Likes
2
Downloads
90
Comments
1

1 Embed 1

https://twitter.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

11 of 1 previous next

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
  • Thank you
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    4 introduction to programming structure 4 introduction to programming structure Document Transcript

    • 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 indentationIntroduction to Programming Structure *Property of STI Page 1 of 11
    • Data Structures and Algorithms Cohesion and CouplingCohesion @ relates to the functional independence of the module and to the performance of a single “task” within the moduleCoupling @ 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 ModulesRules 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 VariablesLocal Variables@ may be used only by the module itselfGlobal Variables@ they are global to the program as they can be seen by all modulesIntroduction to Programming Structure *Property of STI Page 5 of 11
    • Data Structures and Algorithms ParametersParameters @ 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 modulesCalling Module @ the module that processes another moduleCalled Module @ the module being processedIntroduction to Programming Structure *Property of STI Page 6 of 11
    • Data Structures and Algorithms ParametersActual parameter listing @ the list of parameters that follows the module name being processed in the calling moduleFormal Parameter Listing @ the list of parameters that follow the module name at the beginning of the moduleIntroduction 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 referenceIntroduction to Programming Structure *Property of STI Page 8 of 11
    • Data Structures and Algorithms ParametersIntroduction to Programming Structure *Property of STI Page 9 of 11
    • Data Structures and Algorithms ParametersIntroduction 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 • CaseIntroduction to Programming Structure *Property of STI Page 11 of 11