CHAPTER 2 & 3: Pseudocode and Developing and Algorithm

Slides:



Advertisements
Similar presentations
CS107 Introduction to Computer Science Lecture 3, 4 An Introduction to Algorithms: Loops.
Advertisements

CS107: Introduction to Computer Science Lecture 2 Jan 29th.
Repetition control structures
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
Program Design Tool. 6 Basic Computer Operations Receive information Put out information Perform arithmetic Assign a value to variable (memory location)
ITEC113 Algorithms and Programming Techniques
Repetition Control Structure
TEL 104 / MKK Fundamental Programming: Lecture 3
Nassi-Schneidermann Diagrams Lecture 13. Three basic control Structures.
Steps in Program Development
Chapter 2: Algorithm Discovery and Design
Program Design and Development
Repetition Control Structures
Pseudocode.
Pseudocode Algorithms Using Sequence, Selection, and Repetition.
1 Chapter 4 Simple Selections and Repetitions INTRODUCTION The majority of challenging and interesting algorithms necessitate the ability to make.
Pseudocode.
DCT 1123 Problem Solving & Algorithms
Presented by Joaquin Vila Prepared by Sally Scott ACS 168 Problem Solving Using the Computer Week 12 Boolean Expressions, Switches, For-Loops Chapter 7.
Sw development1 Software Development 1.Define the problem (Analysis) 2.Plan the solution 3.Code 4.Test and debug 5.Maintain and Document.
Pseudocode algorithms using sequence, selection and repetition
Selection Control Structures Simple Program Design Third Edition A Step-by-Step Approach 4.
Chapter 7 Array processing. Objectives To introduce arrays and the uses of arrays To develop pseudocode algorithms for common operations on arrays To.
S2008Final_part1.ppt CS11 Introduction to Programming Final Exam Part 1 S A computer is a mechanical or electrical device which stores, retrieves,
Extended Prelude to Programming Concepts & Design, 3/e by Stewart Venit and Elizabeth Drake Chapter 2: Flowcharts.
CSE 102 Introduction to Computer Engineering What is an Algorithm?
C++ Programming Language Lecture 2 Problem Analysis and Solution Representation By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
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.
ITEC113 Algorithms and Programming Techniques
Pseudocode Algorithms Using Sequence, Selection, and Repetition
Basic Control Structures
Control Structures CPS120: Introduction to Computer Science Lecture 5.
Repetition Control Structures Simple Program Design Third Edition A Step-by-Step Approach 5.
Cosc175 - Define Problem/Design Solution/Pseudocode/Trace 1 DEFINE THE PROBLEM.
CSCI-100 Introduction to Computing
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
The Hashemite University Computer Engineering Department
STEP 3- DEVELOP AN ALGORITHM At this stage we break down the problem into simple manageable steps so that they can be handled easily.
LO: We’re learning to outline a program using Pseudo Code.
Lecture Notes 1/20/05 Pseudocode.  Pseudocode standard which we will follow in this class: - Statements are written in simple English; - Each instruction.
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.
1-1 Logic and Syntax A computer program is a solution to a problem.
Algorithm & Programming
Control Statements: Part 1
PROGRAM CONTROL STRUCTURE
Chapter 8 - JavaScript: Control Statements I
Introduction To Flowcharting
Computer Science Faculty
Learning About the Loop Structure (continued)
Chapter 4: Algorithm Design
Program Design Introduction to Computer Programming By:
Pseudocode.
Pseudocode algorithms using sequence, selection and repetition
MSIS 655 Advanced Business Applications Programming
Understanding the Three Basic Structures
Lecture Notes 8/24/04 (part 2)
Iteration: Beyond the Basic PERFORM
Iteration: Beyond the Basic PERFORM
Introduction to Algorithms and Programming
` Structured Programming & Flowchart
Chapter 4: Algorithm Design
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.
CHAPTER 4 Iterative Structure.
COMPUTING.
Introduction to Pseudocode
Presentation transcript:

CHAPTER 2 & 3: Pseudocode and Developing and Algorithm

Objectives Introduce common words & meaningful names Define basic control structures in Structure Theorem Develop an algorithm

Computer Operations Receive information Output information Perform Arithmetic Assign a value Compare variables Repeat actions

Receive information Read and Get Read: receive input from a record on a file Get: receive input from keyboard Example: Read studentName Get systemDate

Output Information Print, Write, Put, Output, Display Examples: Print: output to printer Write: written to a file Put, Output or Display: output to screen Examples: Write customer name to master file Display ‘Total Number’

Arithmetic Add, Subtract, Multiply, Compute etc Examples: Add number to total Total= Total + number Compute C = (F-32)*5/9 Order of operations is very important

Assign a value 3 instances of assigning a value: Initialize: Initialise or Set Result of processing: ‘=‘ or ‘’ Store a value: Save or Store Examples: Initialise total_price to zero total_price= cost_price + sales_tax

Compare Compare 2 variables & select one of the two alternative actions. IF, THEN, ELSE Example: IF student_status is part_time THEN add 1 to part_time_count ELSE add 1 to full_time_count ENDIF

Repeat actions Sequence of processing that need to be repeated DOWHILE, ENDDO Example: DOWHILE student_count <5 Read Student record Print student name, address to report add 1 to student_total ENDDO

Meaningful names Name should describe the type of data in the variable More than one word, use: Camel casing Underscore

Structure Theorem Any computer program can be written using 3 basic control structures: Sequence Selection Repetition

Sequence Straightforward execution of one step after another Example: Statement 1 Statement 2 Statement 3 Receive, output, arithmetic & assign values

Selection Presentation of a condition and choice between 2 actions, depending on TRUE or FALSE Example: IF condition 1 is true THEN statement(s) in true case ELSE statement(s) in false case ENDIF

Repetition Presentation of a set of instructions to be performed repeatedly as long as the condition is true. Example: DOWHILE condition 1 is true statement block ENDDO