Pseudo-code Komate AMPHAWAN.

Slides:



Advertisements
Similar presentations
Lecture 7: Software Design (Part II)
Advertisements

Unit 6 Assignment 2 Chris Boardley.
An Object-Oriented Approach to Programming Logic and Design
Reference :Understanding Computers
Computer Programming Rattapoom Waranusast Department of Electrical and Computer Engineering Faculty of Engineering, Naresuan University.
1 Chapter 2 Problem Solving Techniques INTRODUCTION 2.2 PROBLEM SOLVING 2.3 USING COMPUTERS IN PROBLEM SOLVING : THE SOFTWARE DEVELOPMENT METHOD.
Programming Logic and System Analysis
Fundamentals of C programming
Describe the Program Development Cycle. Program Development Cycle The program development cycle is a series of steps programmers use to build computer.
Selection Control Structure. Topics Review sequence control structure Structure theorem Selection control structure If statement Relational operators.
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.
CMSC 104: Peter Olsen, Fall 99Lecture 9:1 Algorithms III Representing Algorithms with pseudo-code.
The Software Development Process
The Art of Programming. The process of breaking problems down into smaller, manageable parts By breaking the problem down, each part becomes more specific.
1 The Software Development Process ► Systems analysis ► Systems design ► Implementation ► Testing ► Documentation ► Evaluation ► Maintenance.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 4: Introduction to C: Control Flow.
Algorithms 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.
P ROGRAMMING L OGIC GWDA123 Sharon Kaitner, M.Ed. Winter 2015: Week 2.
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.
Flow Charts And Pseudo Codes Grade 12. An algorithm is a complete step-by- step procedure for solving a problem or accomplishing a task.
ICS 3UI - Introduction to Computer Science
Desinging Programs With Flow Charts
2008/09/22: Lecture 6 CMSC 104, Section 0101 John Y. Park
Chapter 2: Input, Processing, and Output
GC211Data Structure Lecture2 Sara Alhajjam.
Chapter 2- Visual Basic Schneider
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
ALGORITHMS AND FLOWCHARTS
Algorithms and Flowcharts
Lecture 2 Introduction to Programming
Introduction To Flowcharting
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.
Introduction to Computer Programming
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Programming Fundamentals
Unit# 9: Computer Program Development
Introduction to pseudocode
2008/09/22: Lecture 5 CMSC 104, Section 0101 John Y. Park
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Global Challenge Night Sensor Lesson 2.
Chapter 2- Visual Basic Schneider
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Global Challenge Night Sensor Lesson 2.
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Chapter 1 Introduction(1.1)
Chapter 2- Visual Basic Schneider
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
How Are Algorithms Developed?
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Global Challenge Night Sensor Lesson 2.
Lecture 7 Algorithm Design & Implementation. All problems can be solved by employing any one of the following building blocks or their combinations 1.
ICT Gaming Lesson 2.
Global Challenge Night Sensor Lesson 2.
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Tonga Institute of Higher Education IT 141: Information Systems
Tonga Institute of Higher Education IT 141: Information Systems
Chapter 2: Input, Processing, and Output
Global Challenge Night Sensor Lesson 2.
Basic Concepts of Algorithm
Global Challenge Night Sensor Lesson 2.
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
Algorithms, Part 2 of 3 Topics Problem Solving Examples Pseudocode
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
Presentation transcript:

Pseudo-code Komate AMPHAWAN

Preliminary Pseudocode is an informal tool that you can use to plan out your algorithms. As you begin to write more complex code, it can be hard to keep an entire program in your head before coding it. Think of pseudocode as a step-by-step verbal outline of your code that you can later transcribe into a programming language.

Preliminary It is a combination of human language and programming language: it mimics the syntax of actual computer code, but it is more concerned with readability than with technical specificity.

Know what pseudocode is.

Pseudocode is a step-by-step verbal outline of your code that you can gradually transcribe into programming language. Many programmers use it to plan out the function of an algorithm before setting themselves to the more technical task of coding. Pseudocode serves as an informal guide, a tool for thinking through program problems, and a communication device that can help you explain your ideas to other people.

Understand why pseudocode is useful.

 Pseudocode is used to show how a computing algorithm should and could work. Coders often use pseudocode as an intermediate step in programming, in between the initial planning stage and the stage of writing actual, executable code. Good pseudocode can become comments in the final program, guiding the programmer in the future when debugging the code, or revising it in the future.

Pseudocode can also be useful for: Describing how an algorithm should work. Pseudocode can illustrate where a particular construct, mechanism, or technique could or must appear in a program. Senior programmers often use the pseudocode to quickly explain the steps their junior programmers need to follow in order to accomplish a required task. Explaining a computing process to less technical people. Computers need a very strict input syntax to run a program, but humans (especially non-programmers) may find it easier to understand a more fluid, subjective language that clearly states the purpose of each line of code.

Designing code in a collaborative development group Designing code in a collaborative development group. High-level software architects will often include pseudocode into their designs to help solve a complex problem they see their programmers running into. If you are developing a program along with other coders, you may find that pseudocode helps make your intentions clear.

Remember that pseudocode is subjective and nonstandard.

There is no set syntax that you absolutely must use for pseudocode, but it is common professional courtesy to use standard pseudocode structures that other programmers can easily understand. If you are coding a project by yourself, then the most important thing is that the pseudocode helps you structure your thoughts and enact your plan.

If you are working with others on a project—whether they are your peers, junior programmers, or non- technical collaborators—it is important to use at least some standard structures so that everyone else can easily understand your intent. If you are enrolled in a programming course at a university, a coding camp, or a company, you will likely be tested against a taught pseudocode "standard". This standard often varies between institutions and teachers.

Clarity is a primary goal of pseudocode, and it may help if you work within accepted programming conventions. As you develop your pseudocode into actual code, you will need to transcribe it into a programming language – so it can help to structure your outline with this in mind.

Understand algorithms.

 An algorithm is a procedure for solving a problem in terms of the actions that a program will take and the order in which it will take those actions. An algorithm is merely the sequence of steps taken to solve a problem.

The steps are normally "sequence," "selection, " "iteration," and a case-type statement. In C, "sequence statements" are imperatives. The "selection" is the "if then else" statement. The iteration is satisfied by a number of statements, such as the "while," " do," and the "for." The case-type statement is satisfied by the "switch" statement.

Remember the three basic constructs that control algorithm flow.

If you can implement a "sequence" function, a "while" (looping) function, and an "if-then-else" (selection) function, then you have the basic tools that you need to write a "proper" algorithm. SEQUENCE is a linear progression where one task is performed sequentially after another. For example: READ height of rectangle READ width of rectangle COMPUTE area as height times width

WHILE is a loop (repetition) with a simple conditional test at its beginning. The beginning and ending of the loop are indicated by two keywords WHILE and ENDWHILE. The loop is entered only if the condition is true. For example: WHILE Population < Limit Compute Population as Population + Births - Deaths ENDWHILE

IF-THEN-ELSE is a decision (selection) in which a choice is made between two alternative courses of action. A binary choice is indicated by these four keywords: IF, THEN, ELSE, and ENDIF. For example: IF HoursWorked > NormalMaximum THEN Display overtime message ELSE Display regular time message ENDIF

References http://www.wikihow.com/Write-Pseudocode

EXAMPLE

Q & A