Free Essay

The Meaning of Psuedocode

In:

Submitted By koolkiddshan
Words 669
Pages 3
The Meaning and Components of Pseudo-code

The first part in designing a program is to understand the tasks that the program is to perform. The second part is to determine the steps that must be taken to perform the tasks. This includes creating a flow chart and using pseudo-code. A flow chart is a diagram that graphically depicts the steps that take place in a program. “Pseudo” is a combining form meaning false, unreal, or fake. So the actual word of Pseudo-code is “Fake Code”.
Pseudo-code is an informal language that has no syntax rules and is not meant to be compiled or executed by the computer, but by the human. Pseudo-code typically omits details that are not essential for human understanding of the algorithm. It is specific documentation that falls between human language and computer programming. It focuses more on the readability and less on syntax. It saves time that is otherwise spent in debugging and testing codes, since it allows programmers to spot and correct errors.
The first parts of a pseudo-code are to define the variables and other elements that will be used to create functionality. A flow chart should be written out to understand the steps at hand, as stated before. Parts of a flow chart include the variables, input and output. The variables being storage locations in memory for data, the output being the data is generated and displayed, and input being the data that a program receives. Computer programs typically follow these three steps: Input is received, some process is performed on the input, and the output is produced.
Pseudo-code is composed of sentences, clauses and words. It follows a structured pattern, with statements written in a sequential order. Pseudo-code uses selection statements (if, then and if, then, else), and the initial keyword in each statement needs to be capitalized. Pseudo-code can be lengthy and complicated when coding a complex problem. There is no one way to write pseudo-code - different programmers write pseudo-code differently, and it can also depend on which programming language they're writing pseudo-code for. When a computer is requested to supply information or output to a device, the verbs Print, Write, Put, Output or Display are used in pseudo-code. Print is used to send the output to the printer, while Write is used for writing to a file. For putting the information to a screen, the common keywords are Put, Display or Output. The following symbols can be used in pseudo-code: + for Add, - for Subtract, * for multiply, / for Divide, ( ) for Parentheses. There are three cases where you may write pseudo-code to assign a value to a variable or memory locations: To give data an initial value. The verbs Initialize or Set are used, to assign a value as a result of some processing, the symbol " = " is used, and To keep a piece of information for later use, the verbs Save or Store is used. Each statement in your pseudo-code 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 pseudo-code. READ, WRITE, IF, ELSE, ENDIF, WHILE, ENDWHILE, REPEAT, UNTIL are keywords for writing a pseudo-code. Capitalize initial keyword. Relational Operators are == Equality, ! = not equal, > greater than, < less than, >= greater than or equal, <= less than or equal. Logical Operators are && Logical And, || Logical Or, ! Not (complement). The programming process is a complicated one. You must first understand the program specifications, of course. Then you need to organize your thoughts and create the program. This is a difficult task when the program is not trivial (i.e. easy). You must break the main tasks that must be accomplished into smaller ones in order to be able to eventually write fully developed code. Writing pseudo-code WILL save you time later during the construction & testing phase of a program’s development.

Similar Documents

Free Essay

Fuzzy Control

...Fuzzy Control Kevin M. Passino Department of Electrical Engineering The Ohio State University Stephen Yurkovich Department of Electrical Engineering The Ohio State University An Imprint of Addison-Wesley Longman, Inc. Menlo Park, California • Reading, Massachusetts Don Mills, Ontaria • Sydney • Bonn • Harlow, England • Berkeley, California • Amsterdam • Mexico City ii Assistant Editor: Laura Cheu Editorial Assistant: Royden Tonomura Senior Production Editor: Teri Hyde Marketing Manager: Rob Merino Manufacturing Supervisor: Janet Weaver Art and Design Manager: Kevin Berry Cover Design: Yvo Riezebos (technical drawing by K. Passino) Text Design: Peter Vacek Design Macro Writer: William Erik Baxter Copyeditor: Brian Jones Proofreader: Holly McLean-Aldis Copyright c 1998 Addison Wesley Longman, Inc. All rights reserved. No part of this publication may be reproduced, or stored in a database or retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, recording, or otherwise, without the prior written permission of the publisher. Printed in the United States of America. Printed simultaneously in Canada. Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and AddisonWesley was aware of a trademark claim, the designations have been printed in initial caps or in all caps. MATLAB is a registered trademark of The MathWorks...

Words: 211473 - Pages: 846