Presentation is loading. Please wait.

Presentation is loading. Please wait.

Computer Science: A Structured Programming Approach Using C1 4-6 Scope Scope determines the region of the program in which a defined object is visible.

Similar presentations


Presentation on theme: "Computer Science: A Structured Programming Approach Using C1 4-6 Scope Scope determines the region of the program in which a defined object is visible."— Presentation transcript:

1 Computer Science: A Structured Programming Approach Using C1 4-6 Scope Scope determines the region of the program in which a defined object is visible. Scope pertains to any object that can be declared, such as a variable or a function declaration. Global Scope Local Scope Topics discussed in this section:

2 Computer Science: A Structured Programming Approach Using C2 FIGURE 4-32 Scope for Global and Block Areas

3 Computer Science: A Structured Programming Approach Using C3 Variables are in scope from declaration until the end of their block. Note

4 Computer Science: A Structured Programming Approach Using C4 It is poor programming style to reuse identifiers within the same scope. Note

5 Computer Science: A Structured Programming Approach Using C5 4-7 Programming Example— Incremental Development Top–down development, a concept inherent to modular programming, allows us to develop programs incrementally. By writing and debugging each function separately, we are able to solve the program in smaller steps, making the whole process easier. First Increment: main and getData Second Increment: add Final Increment: Print ResultsThe Topics discussed in this section:

6 Computer Science: A Structured Programming Approach Using C6 FIGURE 4-33 Calculator Program Design

7 Computer Science: A Structured Programming Approach Using C7 PROGRAM 4-13Calculator Program—First Increment

8 Computer Science: A Structured Programming Approach Using C8 PROGRAM 4-13Calculator Program—First Increment

9 Computer Science: A Structured Programming Approach Using C9 PROGRAM 4-13Calculator Program—First Increment

10 Computer Science: A Structured Programming Approach Using C10 PROGRAM 4-14Calculator Program—Second Increment

11 Computer Science: A Structured Programming Approach Using C11 PROGRAM 4-14Calculator Program—Second Increment

12 Computer Science: A Structured Programming Approach Using C12 PROGRAM 4-14Calculator Program—Second Increment

13 Computer Science: A Structured Programming Approach Using C13 PROGRAM 4-14Calculator Program—Second Increment

14 Computer Science: A Structured Programming Approach Using C14 PROGRAM 4-15Calculator Program—Final Increment

15 Computer Science: A Structured Programming Approach Using C15 PROGRAM 4-15Calculator Program—Final Increment

16 Computer Science: A Structured Programming Approach Using C16 PROGRAM 4-15Calculator Program—Final Increment

17 Computer Science: A Structured Programming Approach Using C17 PROGRAM 4-15Calculator Program—Final Increment

18 Computer Science: A Structured Programming Approach Using C18 4-8 Software Engineering In this section we discuss three different but related aspects of software engineering design: the structure chart, functional cohesion, and top–down development. Structure Charts Structure Chart Rules Functional Cohesion Top–Down Development Topics discussed in this section:

19 Computer Science: A Structured Programming Approach Using C19 FIGURE 4-34 Structure Chart Symbols

20 Computer Science: A Structured Programming Approach Using C20 FIGURE 4-35 Structure Chart Design

21 Computer Science: A Structured Programming Approach Using C21 Structure charts show only function flow; they contain no code. Note

22 Computer Science: A Structured Programming Approach Using C22 FIGURE 4-36 Common Functions in a Structure Chart

23 Computer Science: A Structured Programming Approach Using C23 Table 4-1Structure Chart Rules

24 Computer Science: A Structured Programming Approach Using C24 FIGURE 4-37 Calculate Taxes Design

25 Computer Science: A Structured Programming Approach Using C25 FIGURE 4-38 Design For Print Report

26 Computer Science: A Structured Programming Approach Using C26 PROGRAM 4-16Top–down Development Example

27 Computer Science: A Structured Programming Approach Using C27 PROGRAM 4-16Top–down Development Example

28 Computer Science: A Structured Programming Approach Using C28 PROGRAM 4-16Top–down Development Example


Download ppt "Computer Science: A Structured Programming Approach Using C1 4-6 Scope Scope determines the region of the program in which a defined object is visible."

Similar presentations


Ads by Google