Selection Flow Charts If statements. Flow of Control The flow of control is a concept with which we’re already familiar. The concept of control relates.

Slides:



Advertisements
Similar presentations
Nested if-else Statements.  Should be indented to make the logic clear.  Nested statement executed only when the branch it is in is executed. For example,
Advertisements

Algorithms An algorithm is a finite sequence of instructions, logic, an explicit step-by-step procedure for solving a problem. Specific algorithms sometimes.
Give qualifications of instructors: DAP
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 4 Making Decisions in a Program.
COMPUTER PROGRAMMING I Understand Problem Solving Tools to Design Programming Solutions.
Selection Flow Charts If statements. Flow of Control The flow of control is a concept we’ve already encountered. The concept of control relates to the.
Programs/Algorithms.  Computer Architecture  What is a computer program?  Flow chart  Data states  Data  Variables  History – Why VB?  Procedural.
Creating Flowcharts Principles Of Engineering
UNIT 2. Introduction to Computer Programming
Clearly Visual Basic: Programming with Visual Basic 2008 Chapter 9 Decisions, Decisions, Decisions.
Dr. Gary Stewardson, Raymond Boyles Hello again, Sparkey here. Slippery and I will help you explore how to create a program that simulates outputs on a.
Object is a material thing that can be seen and touched.
Flow Chart.
ITEC113 Algorithms and Programming Techniques
CS 151 Digital Systems Design Lecture 37 Register Transfer Level
Chapter 2- Visual Basic Schneider
PRESENTED BY NASIR ABBAS. FLOW CHART CONTENTS What is a flow chart? Flow chart symbols.
Chapter 4: Control Structures: Selection
Chapter 4 MATLAB Programming Logical Structures Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
1 KU College of Engineering Elec 204: Digital Systems Design Lecture 20 Datapath and Control Datapath - performs data transfer and processing operations.
Developing logic (Examples on algorithm and flowchart)
The Program Design Phases
Algorithm & Flowchart.
ALGORITHMS AND FLOWCHARTS
CSC103: Introduction to Computer and Programming
DCT 1123 Problem Solving & Algorithms
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
CIS Computer Programming Logic
Flow Charting. Goals Create Algorithms using Flow Charting procedures. Distinguish between Flow Charting and Pseudocode. Top-Down Design Bottom-up Design.
Spring 2005, Gülcihan Özdemir Dağ Lecture 3, Page 1 BIL104E: Introduction to Scientific and Engineering Computing, Spring Lecture 3 Outline 3.1 Introduction.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved Computer Organization Six logical units in every.
© Copyright 1992–2004 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Structural Program Development: If, If-Else Outline.
1 Introduction to Flowcharting. 2 Writing a program Defining the problem –Write down what the program will do Planning –Write down the steps, draw a flowchart.
Flowcharts! January 13, 2005 These are today’s notes! Do you think we will get more snow?
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Lecture 2: Logical Problems with Choices. Problem Solving Before writing a program Have a thorough understanding of the problem Carefully plan an approach.
Flowcharts.
Property of Jack Wilson, Cerritos College1 CIS Computer Programming Logic Programming Concepts Overview prepared by Jack Wilson Cerritos College.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
ITEC113 Algorithms and Programming Techniques
Dale Roberts 1 Program Control - Algorithms Department of Computer and Information Science, School of Science, IUPUI CSCI N305.
LO: We’re learning to demonstrate the need for breaking down problems into smaller ones.
Flowcharting An Introduction. Definition A flowchart is a schematic representation of an algorithm or a process.
(C)opyright 2000 Scott/Jones Publishers Introduction to Flowcharting.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
Algorithmic state machines
Learning Objective To be able to… Understand flow chart symbols Complete and correct flow chart algorithms Create a program based on a flow chart.
Flow Charts. Flow charts A flowchart is a schematic (idea of doing something) representation of a process. They are commonly used in Computer Science.
Introduction to Flowcharts
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
Problem Solving Flowcharts. Flowcharts Introduction  Flowcharts allow us to create a visual representation of a solution to a problem DRAW  With flowcharts,
Lecture #8 SWITCH STATEMENT By Shahid Naseem (Lecturer)
Pseudocode (pronounced SOO-doh-kohd)  is a detailed yet readable description of what a computer program or algorithm must do, expressed in a formally-styled.
Understand Problem Solving Tools to Design Programming Solutions
WHAT IS A Process Map? Illustration of the sequence of activities, inputs and outputs to the activities, and relationship across multiple functions, or.
Introduction to Flowcharting
Programming Flowcharts
Chapter 4 MATLAB Programming
Computer Programming Flowchart.
Understand Problem Solving Tools to Design Programming Solutions
Numbering System TODAY AND TOMORROW 11th Edition
Programming Fundamentals
Chapter 2- Visual Basic Schneider
ME 142 Engineering Computation I
System Analysis and Design
KU College of Engineering Elec 204: Digital Systems Design
Introduction to Programming
Structural Program Development: If, If-Else
Introduction to Programming
Introduction to Flowcharts
Presentation transcript:

Selection Flow Charts If statements

Flow of Control The flow of control is a concept with which we’re already familiar. The concept of control relates to the machine level in which a single instruction controls the behaviour of the CPU. The flow of control describes how control passes from one instruction to the next.

Flow Charts A handy way to map the logic of a program is the Flow Chart. Flow Charts use specific shapes to represent computer actions and join these together with arrows to show the flow of control. Each type of action is represented by a specific shape.

Flow Chart Symbols There is no single standard for flow chart shapes, but there is a widely used core set. Start and end symbols, represented as lozenges, ovals or rounded rectangles. Arrows, showing the "flow of control". An arrow coming from one symbol and ending at another symbol represents that control passes in the direction of the arrow.

Flow Chart Symbols Processing steps, represented as rectangles. Input/Output, represented as parallelograms. –Some programmers use different symbols for input than output. –Some even use different symbols for different types of input or output. (printer, screen, speaker, etc.)

Charting the Flow of Control Flow charts help visualise the flow of control. The simplest form is sequence. Declare vars for input and result get input produce result from input show result

Flow Chart Symbols Frequently, a program will need alternative logic paths, one for some data, and another for other data. Flow Charts represent a branch in the logic path with a diamond.

Flow Chart Symbols Conditional (or decision), represented as a diamond (rhombus). These typically contain a Yes/No question or True/False test. This symbol is unique in that it has two arrows coming out of it, one corresponding to Yes or True, and one corresponding to No or False.

Branches in VB6 A branch in the logic of a VB6 program is created by the If statement. If Then … End If

If Then If condition Then ‘body End If Condition True False Process

If …Then…Else If condition Then ‘body Else ‘body End If Condition TrueFalse Process

ElseIf If condition Then ‘body ElseIf condition Then ‘body Else ‘body End If Condition TrueFalse Process Condition TrueFalse Process

Else If If condition Then ‘body Else If condition Then ‘body Else ‘body End If Condition TrueFalse Process Condition TrueFalse Process

Nested Ifs If condition Then ‘body Else ‘body End If Else If condition Then ‘body Else ‘body End If Condition False Condition True Condition Process False True