Presentation is loading. Please wait.

Presentation is loading. Please wait.

Unit 1, Part 2 Introduction to C Programming. Flowchart Elements Unit 1: Algorithms.

Similar presentations


Presentation on theme: "Unit 1, Part 2 Introduction to C Programming. Flowchart Elements Unit 1: Algorithms."— Presentation transcript:

1 Unit 1, Part 2 Introduction to C Programming

2 Flowchart Elements Unit 1: Algorithms

3 Begin and End Shapes These shapes are used to begin and end a flowchart The beginning shape has the algorithm name as its label The end shape contains the word End

4 Rectangle Shape – Actions Rectangle has one entry and one exit The text in the rectangle is pseudo-code corresponding to one step in the algorithm

5 Diamond Shape – Decision Point One entry, two exits (one for yes, the other for no) Contains one question, with yes/no answer

6 Selection Shape Selection is an extension of the decision point Instead of a question, the diamond contains a value The value selects which branch to take One other branch is used for all other values that dont have a branch

7 Connector Shape – On-page Use for a connection on same page Shape shows connection from one point to another Left shape can be used multiple times Right shape, used once, shows the destination of connection

8 Connector Shape – Off-page Use for a flowchart larger than one page Shape shows connection from one page to another Left shape can be used multiple times Right shape, used once, shows the destination of connection Visio automatically creates a new page when this shape used

9 Shapes Combine to Create Structures Straight-line structure Single-sided branch Double-sided branch Selection structure Until loop While loop Do-while loop

10 Straight-line Structure

11 Single-sided Branch

12 Double-sided Branch

13 Selection Structure Selection structure is an extension of the branch All branches must converge together at the end

14 Do-While Loop

15 While Loop

16 Until Loop

17 Flowchart Examples Unit 1: Algorithms

18 Flowchart Example – Count to 9 Here is an algorithm, in pseudo code, to output 1-9: 1. Output List of Numbers less than Put 1 in number 3. Output number 4. Add 1 to number 5. If number is less than 10, go back to step 3 6. End

19 Flowchart Created from Algorithm

20 Flowchart Example – Odd #s < Output List of Odd Numbers less than Put 1 in number 3. If number divided by 2 has remainder 0, go to step 5 4. Output number 5. Add 1 to number 6. If number is less than 10, go back to step 3 7. End

21 Flowchart for Odd Numbers < 10


Download ppt "Unit 1, Part 2 Introduction to C Programming. Flowchart Elements Unit 1: Algorithms."

Similar presentations


Ads by Google