CLASS OBJECTIVE
Know the Raptor programming environment for the first time, by creating a program that performs a basic algorithm to request information, do a process and displays a result.
FLOWCHARTS
Last class you learned how to use 3 flowchart symbols: the elipse (oval), the arrow and the rectangle. Now you'll learn to represent interaction with users though the paralelogram that may represent input and output.
These are the name we'll use from now on:
- Process or assignment, which represent the internal processes like calculations or the manipulation of the information.
- Input ask a user to introduce information, for example, words or numbers.
- Output does exactly the opposite, it shows information to the user, mostly the results of the processes.
Let's try one last paper flowchart using the Input and Output symbols.
RAPTOR PROGRAMMING ENVIRONMENT
Before we start with Raptor you have to install the Direct access icon. Follow the next directions:
- Open the Window´s File Explorer and the "Este equipo" option on the left panel.
- Double click on the Hard Disk Drive (Usually C:)
- Now look for the "Archivos de programa (x86)" folder and get into it.
- Look for the "Raptor_avalonia" folder and get into it.
- Locate the dinosaur icon and right_click on it
- Select the "crear acceso directo" option and agree to put it on the Windows main desk
INTRODUCTION
You've been learning to create problem solutions using technology tools. Now you'll be introduce to programming languages with the Raptor programming environment.
- The Raptor main feature is that the programs will be created using flowcharts.
- With Raptor you´ll create computer algorithms and when you execute them you'll be able to see the process step by step.
- When you open Raptor you'll alway see the oval figures that start and end the program. Between them you'll have to place the flowchart elements that will be executed.
Let's analyze the Raptor main screen in the next image.
FIRST PROGRAM (Guided activity)
Obviously, you'll have to open Raptor usin the "dinosaur icon". It should be installed in your Windows desktop.
Once opened, Raptor will show you 2 windows, the main programming window and the master console. You'll design in the main window but you'll see the results of your algorithm in the master console. (You can look at the image up above)
To start programming, you just have to drag the symbols (input, output and assignment) to the space between the start and end terminals.
- Drag the Input symbol to the main structure
- Double clic on the input symbol.
- "Prompt" is the text that will be shown to the user. Type "What is your name?"
- "Variable" is the name that will be assign to the information container. Type NAME
- Drag the Assignment symbol to the structure
- This is the process that will be executed. Double clic on it.
- Type SALUTE in the SET text box.
- Then type "WELCOME "+NAME+" TO RAPTOR"
- Drag the Output symbol to the structure
- Double clic on it.
- Type "SALUTE" (result container)
- This will be the answer that will be shown in the console window.
To execute the algorithm press the play button. Before, I suggest to slow the execution so you can see it step by step.
To save the algorithm click on the FILE menu, select SAVE: type a name for the file and select a folder.
- Name: Hello world.rap
- Folder: Documents
ACTIVITY
Instead of typing messages, you´ll create a small calculator. Clic on FILE menu and NEW to create a new algorithm.
- Use 2 input symbols to ask for two numbers.
- Use 4 assignment symbols to Add, Subtract, Multiply and Divide.
- Name the result containers as ADDITION, SUBTRACTION, MULTIPLICATION and DIVISION
- Use 4 output symbols to show the results.
Name the file as CALCULATOR.rap and save it into the Documents folder.
After this, you'll deliver this file through a Classroom post.
CLASS NOTES
As always, write down in your notebook the title of this class, the objective and follow the instructions.
- Explain in your own words, What is Raptor?
- What does "programming environment" means? You can use Google.
- Draw the Raptor symbols that we used in today activities.
- We used many variables in today's activities, what is the meaning of variable?