Clase

Páginas: 16 (3876 palabras) Publicado: 4 de abril de 2011
Introduction to Programming with RAPTOR
By Dr. Wayne Brown Puedes descargar este programa y sus manuales en la siguiente dirección http://raptor.martincarlisle.com/ Atte. Centro de Cómputo del ITCV What is RAPTOR? RAPTOR is a visual programming development environment based on flowcharts. A flowchart is a collection of connected graphic symbols, where each symbol represents a specific type ofinstruction to be executed. The connections between symbols determine the order in which instructions are executed. These ideas will become clearer as you use RAPTOR to solve problems. We use RAPTOR in CS110 for several reasons. • The RAPTOR development environment minimizes the amount of syntax you must learn to write correct program instructions. • The RAPTOR development environment is visual.RAPTOR programs are diagrams (directed graphs) that can be executed one symbol at a time. This will help you follow the flow of instruction execution in RAPTOR programs. • RAPTOR is designed for ease of use. (You might have to take our word for this, but other programming development environments are extremely complex.) • RAPTOR error messages are designed to be more readily understandable bybeginning programmers. • Our goal is to teach you how to design and execute algorithms. These objectives do not require a heavy-weight commercial programming language such as C++ or Java. RAPTOR Program Structure A RAPTOR program is a set of connected symbols that represent actions to be performed. The arrows that connect the symbols determine the order in which the actions are performed. When executinga RAPTOR program, you begin at the Start symbol and follow the arrows to execute the program. A RAPTOR program stops executing when the End symbol is reached. The smallest RAPTOR program (which does nothing) is depicted at the right. By placing additional RAPTOR statements between the Start and End symbols you can create meaningful RAPTOR programs. Introduction to RAPTOR Statements/Symbols RAPTORhas six (6) basic symbols, where each symbol represents a unique type of instruction. The basic symbols are shown at the right. The top four statement types, Assignment, Call, Input, and Output, are explained 1 of 12

in this reading, The bottom two types, Selection and Loops, will be explained in a future reading. The typical computer program has three basic components: • INPUT – get the datavalues that are needed to accomplish the task. • PROCESSING – manipulate the data values to accomplish the task. • OUTPUT – display (or save) the values which provide a solution to the task. These three components have a direct correlation to RAPTOR instructions as shown in the following table. Purpose INPUT PROCESSING
St art Symbol St art St art St art

Name input statement assignmentstatement procedure call output statement

Description Allow the user to enter data. Each data value is stored in a variable. Change the value of a variable using some type of mathematical calculation. Execute a group of instructions defined in the named procedure. In some cases some of the procedure arguments (i.e., variables) will be changed by the procedure's instructions. Display (or save to a file)the value of a variable.

PROCESSING

OUTPUT

End End End End

The common thread among these four instructions is that they all do something to variables! To understand how to develop algorithms into working computer programs, you must understand the concept of a variable. Please study the next section carefully! RAPTOR Variables Variables are computer memory locations that hold a datavalue. At any given time a variable can only hold a single value. However, the value of a variable can vary (change) as a program executes. That's why we call them "variables"! As an example, study the following table that traces the value of a variable called X. Description Value of Program X • When the program begins, no variables exist. In RAPTOR, variables are automatically created when...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Clases
  • Clase
  • Clase
  • CLASES
  • Clase
  • clases
  • clases
  • clases

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS