Flowcharts. Problem Solving Computer programs are written to solve problems or perform tasks Programmers translate the solutions or tasks into a language.

Slides:



Advertisements
Similar presentations
Program Development Cycle Prof. Carlos Rodríguez Sánchez.
Advertisements

CS101: Introduction to Computer programming
PROBLEM SOLVING TECHNIQUES
Introductory Computer Sciences
1.4 Programming Tools Flowcharts Pseudocode Hierarchy Chart
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.
Mathematics for Computing Lecture 4: Algorithms and flowcharts Dr Andrew Purkiss-Trew Cancer Research UK
Chapter 2 - Problem Solving
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
Programming Logic and Design, Introductory, Fourth Edition1 Understanding Computer Components and Operations (continued) A program must be free of syntax.
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
Algorithm & Flowchart.
Introduction to Computers and Programming
Computer Programming 12 Lesson 2 - Organizing the Problem By Dan Lunney.
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.
IE 212: Computational Methods for Industrial Engineering
Design the program Create a detailed description of program –Use charts or ordinary language (pseudocode) Identify algorithms needed –Algorithm: a step-by-step.
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.
PROGRAMMING LANGUAGES Prof. Lani Cantonjos. PROGRAM - set of step-by-step instructions that tells or directs the computer what to do. PROGRAMMING LANGUAGE.
Chapter 2 - VB.NET by Schneider1 Chapter 2 - Problem Solving Program Development Cycle Programming Tools.
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Chapter 2 Problem Solving On A Computer 2.1 Problem Solving Steps Solving a problem on a computer requires steps similar to those followed when solving.
Problem Solving Techniques. Compiler n Is a computer program whose purpose is to take a description of a desired program coded in a programming language.
IXA 1234 : C++ PROGRAMMING CHAPTER 1. PROGRAMMING LANGUAGE Programming language is a computer program that can solve certain problem / task Keyword: Computer.
ALGORITHM List of instructions for carrying out some process step by step. A sequence of instructions which has a clear meaning and can performed with.
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.
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 Topics 2.1 Designing a Program 2.2 Output, Input, and Variables 2.3 Variable Assignment and Calculations 2.4 Variable Declarations and Data Types.
Chapter 2 - VB 2005 by Schneider- modified by S. Jane '081 Chapter 2 - Problem Solving 2.1 Program Development Cycle 2.2 Programming Tools.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Expressing Algorithms as Flowcharts and Pseudocode
FLOWCHARTING AND ALGORITHMS
Flowcharts C++ Lab. Algorithm An informal definition of an algorithm is: a step-by-step method for solving a problem or doing a task. Input data A step-by-step.
STEP 3- DEVELOP AN ALGORITHM At this stage we break down the problem into simple manageable steps so that they can be handled easily.
Lecture 3: Developing Procedural Thinking (How to think like a programmer) B Burlingame 16 Feb 2016.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Victoria Ibarra Mat:  Generally, Computer hardware is divided into four main functional areas. These are:  Input devices Input devices  Output.
Program Development Cycle
Chapter 2- Visual Basic Schneider
Introduction to Computing
Algorithms and Flowcharts
Algorithms An algorithm is a sequence of steps written in the form of English phrases that specific the tasks that are performed while solving the problem.It.
Unit# 9: Computer Program Development
Chapter 2- Visual Basic Schneider
Chapter 1 - An Introduction to Computers and Problem Solving
CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING
Chapter 2- Visual Basic Schneider
ME 142 Engineering Computation I
Flowcharts and Pseudocode
Understanding Problems and how to Solve them by using Computers
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Presentation transcript:

Flowcharts

Problem Solving Computer programs are written to solve problems or perform tasks Programmers translate the solutions or tasks into a language the computer can understand The computer will only do what we instruct it to do We need to be careful and thorough with our instructions

Designing a Computer Program 1.Determine what the output should be 2.Identify the data or input needed to produce that output 3.Determine how to process the input to obtain the desired output

Designing a Computer Program Consider the following problem –How fast is a car travelling if it travels 135 miles in 3 hours 1.What is the type of answer required (the output)? 2.What information (the input) is needed to obtain this output? 3.What is the process that transforms the input into the output?

Pictorial Representation

Program Development Consider the development process or strategy that should be adopted when developing a program similar to the ones you are/have developed in your programming course

Program Development 1.Analysis: Define the problem 2.Design: Plan the solution…a logical sequence of precise steps (Algorithm) 3.Implementation: Translate the algorithm into a programming language 4.Testing and Debugging: Locate and remove any errors in the program 5.Complete the documentation

Helpful Tools Converting algorithms into computer programs –Flowcharts – graphically depict the logical steps of the program and show how the steps are related to each other –Pseudocode – Use English-like phrases with some programming terminology to outline the program

Flowcharts Consists of geometric symbols connected by arrows Within each symbol: a phrase presenting the activity at that step Shape of symbol: indicates type of operation that is to take place Arrows connecting symbols (flowlines): show the progression in which the steps take place

Flowchart Symbols Flowline Terminal Input/Output Processing Decision

Flowchart Symbols Connector Off-page connector Predefined Process Annotations

Postage Stamp Problem Algorithms are used every day for decision making Consider the following problem –Any time you post a letter you must decide how much postage to put on the envelope. One rule of thumb might be to use one stamp for every five sheets or fraction thereof. Suppose a colleague asks you to determine the number of stamps they need on an envelope. What algorithm should you adopt?

Algorithm for Postage Stamp Problem 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) Display graphically this algorithm, highlighting the input, processing and output Task: Test the algorithm for letters with different numbers of stamps….

Flowchart for Postage stamp problem Sequence Structure

Pseudocode for Postage Stamp Problem Program: Determine the proper number of stamps for a letter Read Sheets Set the number of stamps to Sheets/5 Round the number of stamps up to the next whole number Display the number of stamps

Including decisions in flowcharts IF condition is true THEN Process Step 1 ELSE Process step 2 END IF

Combine Sequence and Decision Structures Given a street number of a one-way street in New York, decide the direction of the street –Rule: Even number means Eastbound street Generate the pseudocode and flowchart for this problem Recall:

Loops in flowcharts WHILE condition is true Process Steps LOOP

Problem Calculate and report the average QCA for the class Determine –Input –Processing –Output

Symbols Preparation (usually used for loops, i.e. the initialisation of variables) In this lecture flowcharts for while, do-while and for loops that use and do not use the preparation symbol will be considered.

Links ow.htm#exercise1http://users.evtek.fi/~jaanah/IntroC/DBeech/3gl_fl ow.htm#exercise1 mentLibraryManager/upload/program_intro.pdfhttp:// mentLibraryManager/upload/program_intro.pdf (especially lesson 2)

Summary Problem Solving Designing a Computer Program Input Processing and Output Flowcharts and Pseudocode Flowchart symbols Flowchart sequence and decision Looping in flowcharts