1.4 Programming Tools Flowcharts Pseudocode Hierarchy Chart

Slides:



Advertisements
Similar presentations
CE 311 K Introduction to Computer Methods VB Controls and Events Daene C. McKinney.
Advertisements

CS101: Introduction to Computer programming
PROBLEM SOLVING TECHNIQUES
Introductory Computer Sciences
PSEUDOCODE & FLOW CHART
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2 - Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 2 - Problem Solving
Fundamentals of Algorithms MCS - 2 Lecture # 4
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider
Programming Tools Flowcharts Pseudocode Algorithm Chapter 2.
Introduction to Computing Dr. Nadeem A Khan. Lecture 4.
Introduction to Computing Dr. Nadeem A Khan. Lecture 4.
The Program Development Cycle and Program Design Tools
Chapter 2: Developing a Program Extended and Concise Prelude to Programming Concepts and Design Copyright © 2003 Scott/Jones, Inc.. All rights reserved.
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
Developing logic (Examples on algorithm and flowchart)
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 3P. 1Winter Quarter Structured Engineering.
Introduction to Computing Dr. Nadeem A Khan. Lecture 5.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
The Program Design Phases
Review Algorithm Analysis Problem Solving Space Complexity
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 3P. 1Winter Quarter Structured Engineering.
Introduction to Computers and Programming
ALGORITHMS AND FLOWCHARTS
1 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and Files 1.3 Program Development.
Chapter 1 - VB 2008 by Schneider1 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and.
Chapter 2 - VB.NET by Schneider1 Chapter 2 - Problem Solving Program Development Cycle Programming Tools.
BACS 287 Programming Logic 1. BACS 287 Programming Basics There are 3 general approaches to writing programs – Unstructured – Structured – Object-oriented.
PSEUDOCODE C Programming Technique – Firdaus-Harun.com.
Flowcharts. Problem Solving Computer programs are written to solve problems or perform tasks Programmers translate the solutions or tasks into a language.
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
Chapter 11 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and Files 1.3 Program Development.
PROGRAM DEVELOPMENT CYCLE. Problem Statement: Problem Statement help diagnose the situation so that your focus is on the problem, helpful tools at this.
1 Program Planning and Design Important stages before actual program is written.
Programming at a high level. Developing a Computer Program Programmer  Writes program in source code (VB or other language) Compiler  Converts source.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 3P. 1Winter Quarter Structured Engineering Problem Solving and Logic.
1 Programming Tools Flowcharts Pseudocode Hierarchy Chart Direction of Numbered NYC Streets Algorithm Class Average Algorithm.
Chapter 1 - VB 2008 by Schneider1 Chapter 1 - An Introduction to Computers and Problem Solving 1.1 An Introduction to Computers 1.2 Windows, Folders, and.
Fundamentals of Algorithms MCS - 2 Lecture # 5. Representation of Algorithms (continued) Flowcharts.
Introduction to Computing Dr. Nadeem A Khan. Lecture 2.
Chapter 2 - VB 2005 by Schneider- modified by S. Jane '081 Chapter 2 - Problem Solving 2.1 Program Development Cycle 2.2 Programming Tools.
Problem-solving with Computers. 2Outline  Computer System  5 Steps for producing a computer program  Structured program and programming  3 types of.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Expressing Algorithms as Flowcharts and Pseudocode
ALGORITHMS AND FLOWCHARTS. Why Algorithm is needed? 2 Computer Program ? Set of instructions to perform some specific task Is Program itself a Software.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
CSE 110: Programming Language I Matin Saad Abdullah UB 404.
 Problem Analysis  Coding  Debugging  Testing.
Algorithms and Flowcharts
Program design Program Design Process has 2 phases:
GC101 Introduction to computers and programs
Chapter 2- Visual Basic Schneider
ALGORITHMS AND FLOWCHARTS
Introduction to Computing
CS1001 Programming Fundamentals 3(3-0) Lecture 2
ALGORITHMS AND FLOWCHARTS
Algorithms & Pseudocode
ALGORITHMS AND FLOWCHARTS
Chapter 2- Visual Basic Schneider
Introduction to Algorithms and Programming
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider
Flowcharts and Pseudocode
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Introduction to Programming
Basic Concepts of Algorithm
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Presentation transcript:

1.4 Programming Tools Flowcharts Pseudocode Hierarchy Chart Direction of Numbered NYC Streets Algorithm Class Average Algorithm

Flowcharts and Pseudocode

Programming Tools Three tools are used to convert algorithms into computer programs: Flowchart - Graphically depicts the logical steps to carry out a task and shows how the steps relate to each other. Pseudocode - Uses English-like phrases with some Visual Basic terms to outline the program.

Problem solving example How many stamps do you use when mailing a letter? One rule of thumb is to use one stamp for every five sheets of paper or fraction thereof.

Algorithm 1. Request the number of sheets of paper; call it Sheets. (input) 2. Divide Sheets by 5. (processing) 3. Round the quotient up to the next highest whole number; call it Stamps. (processing) 4. Reply with the number Stamps. (output)

Flowcharts Graphically depict the logical steps to carry out a task and show how the steps relate to each other.

Flowchart symbols

Flowchart symbols continued

Flowchart example

Pseudocode Uses English-like phrases to outline the task.

Pseudocode example Determine the proper number of stamps for a letter Read Sheets (input) Set the number of stamps to Sheets / 5 (processing) Round the number of stamps up to the next whole number (processing) Display the number of stamps (output)

Divide-and-conquer method Used in problem solving – take a large problem and break it into smaller problems solving the small ones first Breaks a problem down into modules

Statement structures Sequence – follow instructions from one line to the next without skipping over any lines Decision - if the answer to a question is “Yes” then one group of instructions is executed. If the answer is “No,” then another is executed Looping – a series of instructions are executed over and over

Sequence flow chart

Decision flow chart

Looping flow chart

Direction of Numbered NYC Streets Algorithm Problem: Given a street number of a one-way street in New York City, decide the direction of the street, either eastbound or westbound Discussion: in New York City even numbered streets are Eastbound, odd numbered streets are Westbound

Flowchart

Pseudocode Program: Determine the direction of a numbered NYC street Get street If street is even Then Display Eastbound Else Display Westbound End If

Class Average Algorithm Problem: Calculate and report the grade-point average for a class Discussion: The average grade equals the sum of all grades divided by the number of students Output: Average grade Input: Student grades Processing: Find the sum of the grades; count the number of students; calculate average We need a loop to read and then add (accumulate) the grades for each student in the class. Inside the loop, we also need to total (count) the number of students in the class. See Figures 2.8 to 2.10. grade = sum of grades / number of students.

Flowchart

Pseudocode Program: Determine the average grade of a class Initialize Counter and Sum to 0 Do While there are more data Get the next Grade Add the Grade to the Sum Increment the Counter Loop Computer Average = Sum / Counter Display Average

Tips and tricks of flowcharts Flowcharts are time-consuming to write and difficult to update For this reason, professional programmers are more likely to favor pseudocode and hierarchy charts Because flowcharts so clearly illustrate the logical flow of programming techniques, they are a valuable tool in the education of programmers

Tips and tricks of pseudocode There are many styles of pseudocode Some programmers use an outline form Some use a form that looks almost like a programming language The pseudocode in the case studies of this text focus on the primary tasks to be performed by the program and leaves many of the routine details to be completed during the coding process

URL’s for free Flowcharting software www.smartdraw.com www.gliffy.com/uses/flowchart-software/ www.breezetree.com/flowcharting-software/ Flowchart Software, FREE Flowchart Examples and Templates ... www.edrawsoft.com/flowchart.php