Pseudocode An Introduction. Flowcharts were the first design tool to be widely used, but unfortunately they do not reflect some of the concepts of structured.

Slides:



Advertisements
Similar presentations
WASHING UP. This is a very important job. If it is not done correctly then the next person to use the equipment could get food poisoning.
Advertisements

Lab Management Information. Before Starting a Lab:  1. Wash hands with hot, soapy water for 20 seconds. Rewash whenever necessary.  2. Long hair must.
 Step one is to get a paper towel and set it by the sink.
How Are Algorithms Developed?
Chapter 2: Problem Solving
Describing Process Specifications and Structured Decisions Systems Analysis and Design, 7e Kendall & Kendall 9 © 2008 Pearson Prentice Hall.
Chapter 1 - An Introduction to Computers and Problem Solving
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
1 Pseudocode For Program Design. 22 Rules for Pseudocode Write only one statement per line Capitalise initial keyword Indent to show hierarchy and structures.
What is Pseudocode? Pseudocode is "halfway" between english and a programming language. It is a description of a process in detail, though not necessarily.
Starting Out with C++, 3 rd Edition 1 Chapter 1. Introduction to Computers and Programming.
Robot Programming. Programming Behaviors Behaviors describe the actions and decisions of your robot.
System Concepts for Process Modeling  Process Concepts  Process Logic  Decomposition diagrams and data flow diagrams will prove very effective tools.
Chapter 9 Describing Process Specifications and Structured Decisions
1 Chapter 8 Designing Small Programs. 2 A ‘Procedure’ v A set of instructions which describe the steps to be followed in order to carry out an activity.
Chapter 3 Planning Your Solution
Review Algorithm Analysis Problem Solving Space Complexity
Programming Logic and System Analysis
Lab Rules.  Place Measuring Tools on Red Tray  Go to the Supply Table to get ingredients  If you spill please clean up your mess.
CSCI 200 Introduction To Programming with Visual Basic Bob Bradley.
Hand Dishwashing Strategies. Using efficient dishwashing strategies will yield cleaner dishes in a shorter amount of time.
Introduction By: Dr. Javad Razjouyan. Programming Languages.
King Saud University College of applied studies and community services CSC 1101 Computer Programming I Lecture 2.
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
Lab Procedures and Management. Before Starting a Lab:  1. Wash hands with hot, soapy water for 30 seconds. Rewash whenever necessary.  2. Long hair.
Getting organized for a Foods Lab. Planning your work When you think ahead and get ready to start work, your food lab will be more enjoyable and will.
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.
Introduction to Computer Application (IC) MH Room 517 Time : 7:00-9:30pm.
Dish Washing Its dirty little job but every ones going to have to do it.
Pseudocode An Introduction. Flowcharts were the first design tool to be widely used, but unfortunately they do not reflect some of the concepts of structured.
Software Development. Software Development Loop Design  Programmers need a solid foundation before they start coding anything  Understand the task.
Lab Management Information. Before Starting a Lab: 1. Wash hands with hot, soapy water for 20 seconds. Rewash whenever necessary. 2. Long hair must be.
Lab Management Information. Before Starting a Lab:  1. Wash hands with hot, soapy water for 20 seconds. Rewash whenever necessary.  2. Long hair must.
Dishwashing Supplies needed Hot water A sink or pan for washing dishes A place to drain dishes Hand dishwashing detergent Non-scratch pad for stuck on.
DATA STRUCTURES (CS212D) Overview & Review Instructor Information 2  Instructor Information:  Dr. Radwa El Shawi  Room: 
Algorithms and Pseudocode
Lab Management Information. Before Starting a Lab:  1. Wash hands with hot, soapy water for 20 seconds. Rewash whenever necessary.  2. Long hair must.
P ROGRAMMING L OGIC GWDA123 Sharon Kaitner, M.Ed. Winter 2015: Week 2.
Sorting Algorithms. Algorithms, revisited What is an algorithm? Wikipedia Definition: an algorithm is a definite list of well-defined instructions for.
Fundamentals of Algorithms MCS - 2 Lecture # 3. Representation of Algorithms.
How Computers Solve Problems Computers also use Algorithms to solve problems, and change data into information Computers can only perform one simple step.
Pseudocode. Algorithm A procedure for solving a problem in terms of the actions to be executed and the order in which those actions are to be executed.
Programming Basics - RobotC Introduction to Robotics.
Copyright © 2011 Pearson Education, Inc. Publishing as Prentice Hall Process Specifications and Structured Decisions Systems Analysis and Design, 8e Kendall.
Decision Tables and Pseudocode
Programming Language Basics. What is a Programming Language? “A computer, human-created language used to write instructions for a computer.” “An artificial.
Computer Applications in Business
Lab Management Information
Day 1: Beginning Exploring
Day 2: What variables decrease enzyme function?
Software Development.
Pseudocode An Introduction
Topic: Programming Languages and their Evolution + Intro to Scratch
Programming Languages
High and low level languages
Kitchen Job Descriptions
Foods Lab Procedures and Expectations
Data Structures (CS212D) Overview & Review.
Pseudocode An Introduction
(Course Introduction)
Programming Language Basics
Understanding Problems and how to Solve them by using Computers
How Are Algorithms Developed?
ICT Programming Lesson 1:
Lecture 7 Algorithm Design & Implementation. All problems can be solved by employing any one of the following building blocks or their combinations 1.
Introduction to Programming
Reflecting, Learning, Improving
Chapter 1 Introduction to Programming
Pseudocode For Program Design.
Presentation transcript:

Pseudocode An Introduction

Flowcharts were the first design tool to be widely used, but unfortunately they do not reflect some of the concepts of structured programming very well. Pseudocode, on the other hand, is a newer tool and has features that make it more reflective of the structured concepts. The drawback is that the narrative presentation is not as easy to understand and/or follow.

What is Pseudocode? Pseudocode is "halfway" between english and a programming language. It is a description of a process in detail, though not necessarily in full sentences. The key is to provide enough information so that anyone could follow the instructions (a child, an alien, or even a computer, if the instructions were translated into a language it understands). Recipes are one type of pseudocode, instructions for assembling things are another.

Rules for Pseudocode Write only one statement per line Capitalize initial keyword Indent to show hierarchy End multiline structures Keep statements language independent

One Statement Per Line Each statement in pseudocode should express just one action for the computer. If the task list is properly drawn, then in most cases each task will correspond to one line of pseudocode. Task List Read name, hours worked, rate of pay Perform calculations gross = hours worked * rate of pay Write name, hours worked, gross Pseudocode READ name, hoursWorked, payRate gross = hoursWorked * payRate WRITE name, hoursWorked, gross

Capitalize Initial Keyword In the example below note the words: READ and WRITE. These are just a few of the keywords to use, others include: READ, WRITE, IF, ELSE, ENDIF, WHILE, ENDWHILE Pseudocode READ name, hoursWorked, payRate gross = hoursWorked * payRate WRITE name, hoursWorked, gross

Example of Pseudocode for Washing the Dishes close the sink drain hole squirt some dish liquid in the sink turn on hot water WHILE sink is not full wait 2 seconds splash water to create bubbles turn off water (sink is now full of hot, soapy water) put a dishrag in the sink WHILE there are dirty dishes grab a dish put dish in the sink scrub dish with dishrag IF dish is still dirty THEN scrub dish with scouring pad rinse dish put dish in drainer open the sink drain hole put dishrag in laundry basket Drying the dishes is left as an exercise to the reader :) Even though this description is fairly complex, it still has some pieces missing. If there are nonstick dishes, we don't want to scratch them with the scouring pad. We don't want to wash greasy dishes first, since they will make the water dirty. There are no instructions for times when the dish drainer is full... The pseudocode you write should be detailed enough that it can be understood (by a child, alien, or computer) without being so detailed that it becomes difficult to follow.

Advantages & Disadvantages Flowchart Advantages: Standardized Visual Pseudocode Advantages Easily modified Implements structured concepts Done easily on Word Processor Flowchart Disadvantages: Hard to modify Structured design elements not implemented Special software required Pseudocode Disadvantages: Not visual No accepted standard, varies from company to company

References sson3.htmlhttp:// sson3.html eudocode%20Basics.ppthttp://faculty.ccri.edu/mkelly/COMI1150/Ps eudocode%20Basics.ppt