Raptor

Páginas: 15 (3617 palabras) Publicado: 4 de octubre de 2012
Introduction to Programming with RAPTOR
By Dr. Wayne Brown

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 of instruction to be executed. The connections between symbols determine the order in which instructions are executed. These ideas willbecome 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 ofinstruction 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 by beginning programmers.
• Our goal is to teach you how to design and execute algorithms. These objectives do not require aheavy-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 executing a RAPTOR program, you begin at the Start symbol and follow the arrows to execute the program. A RAPTOR program stopsexecuting 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
RAPTOR has six (6) basic symbols, where each symbol represents a unique type of instruction. The basic symbols are shownat the right. The top four statement types, Assignment, Call, Input, and Output, are explained 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 data values 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 Symbol Name Description
INPUT input statement Allow the user to enter data. Each data value is stored in a variable.
PROCESSING assignment statement Change the value of a variable using some type ofmathematical calculation.
PROCESSING procedure call 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.
OUTPUT output statement Display (or save to a file) the value of a variable.

The common thread among these four instructions is that they all do something tovariables! 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 data value. 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 wecall them "variables"! As an example, study the following table that traces the value of a variable called X.
Description Value of X Program

• When the program begins, no variables exist. In RAPTOR, variables are automatically created when they are first used in a statement.
Undefined
• The first assignment statement, X←32, assigns the data value 32 to the variable X. 32
• The next...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Raptor
  • raptor
  • Raptor
  • raptor
  • raptor
  • El Raptor
  • raptor
  • Raptor

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS