Flowchart IDT
What is a flowchart? Visual representation of a flow of data Outline of process or a solution to a problem Outline the basic logic behind a software or program Principal rule: one-in-one-out Only ONE way INTO the structure Only ONE way OUT of the structure Direction = flow of the procedure or system top to bottom left to right
Example Borrow a book from the library with a library card: 1. Do I have my library card with me? Yes - proceed to next step. No - find my library card. 2. Go to library. 3. Search for a book. 4. Sign out the book.
Basic Flowchart Symbols Symbol NameFunction Start/EndShows the beginning and end of the system or process ProcessAn action done by the program (e.g. calculate the area of a square) ArrowsShows the direction and sequence of processes DecisionAsks a question and then determines which route the program will take
Basic Flowchart Symbols SymbolNameFunction Input/ Output Represents when something is input into the program or output from the program ConnectorConnects one part of the flowchart to another part of the flowchart on the same page using matching symbols Off-page Connector Connects one part of the flowchart to another part of the flowchart on a different page using matching symbols
Sequence Control Structure All actions must be executed Only one way to enter this sequence structure (at the start) Only one way to exit the structure (at the end) What is the output?
Decision or Selection Control Structure Only one way to enter the program Only one way to exit the program - even though there are several possible paths to take once you come across a decision (the diamond symbols) Which action to take is based on a certain condition What is the output?
Repetition or Loop Control Structure Do While or do until What is the output? Sum of First 50 natural numbers
Sample Flow Charts Decision/ Selection Structure
Sample Flow Charts
Let’s practice You want to buy a computer that will cost $2000. You don’t have the money yet, but you plan to save $100 each month toward the purchase. Create a flow chart using selection/decision and repetition.
Computer Purchase Flow Chart
Assignment Select an everyday activity Create a decision/selection flow chart for the activity. Use the correct shapes for start/end, direction, process, decisions, etc.