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.

Slides:



Advertisements
Similar presentations
ALGORITHMS AND FLOWCHARTS
Advertisements

Algorithms 10 IST – Topic 6.
CS101: Introduction to Computer programming
Project on VB Control Structures
More on Algorithms and Problem Solving
CHAPTER 5: Repetition Control Structure. Objectives  To develop algorithms that use DOWHILE and REPEAT.. UNTIL structures  Introduce a pseudocode for.
Understanding the Three Basic Structures
An Object-Oriented Approach to Programming Logic and Design
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
Programming Logic and Design Seventh Edition
Program Design Tool. 6 Basic Computer Operations Receive information Put out information Perform arithmetic Assign a value to variable (memory location)
1 Pseudocode For Program Design. 22 Rules for Pseudocode Write only one statement per line Capitalise initial keyword Indent to show hierarchy and structures.
Programming Logic and Design Seventh Edition
Steps in Program Development
Chapter 2: Algorithm Discovery and Design
Program Design and Development
Pseudocode.
1 Chapter 2 Problem Solving Techniques INTRODUCTION 2.2 PROBLEM SOLVING 2.3 USING COMPUTERS IN PROBLEM SOLVING : THE SOFTWARE DEVELOPMENT METHOD.
Pseudocode.
Adapted from slides by Marie desJardins
DCT 1123 Problem Solving & Algorithms
PROGRAMMING, ALGORITHMS AND FLOWCHARTS
Selection Control Structure. Topics Review sequence control structure Structure theorem Selection control structure If statement Relational operators.
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.
ㅎㅎ logical operator if if else switch while do while for Third step for Learning C++ Programming Repetition Control Structures.
Chapter 2 Pseudocode. Objectives To introduce common words, keywords and meaningful names when writing pseudocode To define the three basic control structures.
Pseudocode. Simple Program Design, Fourth Edition Chapter 2 2 Objectives In this chapter you will be able to: Introduce common words, keywords, and meaningful.
Pseudocode Simple Program Design Third Edition A Step-by-Step Approach 2.
ALGORITHMS AND FLOWCHARTS CSCI 105 – Computer Fluency.
PROGRAMMING PAPER 2 AS Algorithms.
Dale Roberts 1 Program Control - Algorithms Department of Computer and Information Science, School of Science, IUPUI CSCI N305.
Control Structures CPS120: Introduction to Computer Science Lecture 5.
CMSC 104: Peter Olsen, Fall 99Lecture 9:1 Algorithms III Representing Algorithms with pseudo-code.
A loop is a repetition control structure. body - statements to be repeated control statement - decides whether another repetition needs to be made leading.
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 Logic and Design, Introductory, Fourth Edition1 Understanding the Three Basic Structures Structure: a basic unit of programming logic Any program.
Algorithms and Pseudocode
STEP 3- DEVELOP AN ALGORITHM At this stage we break down the problem into simple manageable steps so that they can be handled easily.
P ROGRAMMING L OGIC GWDA123 Sharon Kaitner, M.Ed. Winter 2015: Week 2.
Flow Control in Imperative Languages. Activity 1 What does the word: ‘Imperative’ mean? 5mins …having CONTROL and ORDER!
Fundamentals of Algorithms MCS - 2 Lecture # 3. Representation of Algorithms.
Control Structure  What is control Structure?  Types of Controls  Use the control structure in VBScript.  Example Summery.
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 Analysis  Coding  Debugging  Testing.
Decision Tables and Pseudocode
Programming Logic and Design Fourth Edition, Introductory Chapter 2 Understanding Structure.
Loops causes program to execute the certain block of code repeatedly until some conditions are satisfied. Suppose you want to execute some code/s 10 times.
Pseudocode Upsorn Praphamontripong CS 1110 Introduction to Programming
Transition to Code Upsorn Praphamontripong CS 1110
Introduction To Flowcharting
Programming Fundamentals
CHAPTER 2 & 3: Pseudocode and Developing and Algorithm
Pseudo-code Komate AMPHAWAN.
Pseudocode An Introduction
Program Design Introduction to Computer Programming By:
Introduction to pseudocode
Pseudocode.
Understanding the Three Basic Structures
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Data and Flowcharts Session
Understanding Problems and how to Solve them by using Computers
Computer Science Core Concepts
ICT Programming Lesson 3:
Click to add Text Computers & Instructions. Computers are given instructions in the form of computer programs that are created through the development.
Data and Flowcharts Session
ICT Gaming Lesson 2.
Data and Flowcharts Session
Pseudocode For Program Design.
Introduction to Pseudocode
Presentation transcript:

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. It is merely the sequence of steps taken to solve a problem The steps are normally  Sequence  Selection  Iteration (Repetition)

Pseudocode A kind of structured English terminology for describing algorithms. Allows the designer to focus on the logic of the algorithm without being distracted by details of language syntax.

Rules for Pseudocode 1. Write only one statement per line  each statement should express just one action for the computer 2. Capitalize initial keyword  READ, WRITE, IF, ELSE, ENDIF, WHILE, ENDWHILE, REPEAT, UNTIL 3. Indent to show hierarchy  Sequence: keep statements that are stacked in sequence all starting in the same column  Selection: indent the statements that fall inside the selection structure, but not the keywords that form the selection  Looping: indent the statements that fall inside the loop, but not the keywords that form the loop

Rules for Pseudocode 4. End multiline structures: For example, The “EndIF” is always inline with the “IF” that began the multiline structure. 5. Keep statements language independent  The vocabulary should be the vocabulary of the problem domain, not of the implementation domain.

The Structure Theorem It’s possible to write any computer program by using only three (3) basic control structures  Sequence  Selection  Repetition (Iteration)

Sequence Execution of one step after another This is represented as a sequence of pseudocode statements Example: Read three numbers Add three numbers Display total of three numbers

Selection Presentation of a condition, for example, the choice between two actions, with the choice depending on whether the condition is true or false This represents the decision making abilities of the computer to compare two pieces of information and select one of two alternative actions. In pseudocode, selection is represented by the keywords IF, THEN, ELSE, and ENDIF

SELECTION IF condition p is true THEN statement(s) in true case ELSE statement(s) in false case ENDIF *********************************** IF student is part_time THEN Add one to part_time_count ELSE Add one to full_time_count ENDIF

REPETITION Presentation of a set of instructions to be performed repeatedly, as long as a condition is true. WHILE condition p is true Statement(s) to execute ENDWHILE

REPETITION Set student_total to 0 WHILE student_total<50 Read student record Print student name and address Add 1 to student_total ENDWHILE

Monopoly Pseudocode

Monopoly Pseudocode/Flowchart utline/chap05/misc/monopoly.htm