Introduction to Flowcharting using Raptor
This lab teaches you the following topics:
An introduction to Raptor Tool
Basic flowchart Symbols
Creating, Running and Saving flowcharts in Raptor
Make yourself familiar with the Raptor Tool
- Understand the symbols for Input, Process and Output
- Placing symbols and saving your first flowchart
- Running the flowchart and getting the output in console
Making program flowcharts is a powerful technique for logic building and learning syntax free programming. Using Raptor, a GUI based drag and drop tool you can easily test your logic building skill, just drape your logic with the syntax of any programming language and claim yourself to be a programmer.
Create flowchart for “Hello World
Launch Raptor, you will see two set of windows, the main working pane and the console window.
The main window is where you can drag and drop symbols and test your logic while the console window gives you output and some basic information regarding the last execution done.
The start and end symbols are placed by default.
Task 1.1: Hello World and it’s Execution
- Pick the output symbol from symbols pane and drag it in between the start and end symbol, the application might ask you to save your work, give it a meaningful name like HelloWorld and it
will be saved with rap extension.
- Single click inside the output symbol to select it.
- Double click inside the output symbol and you will see a popup window asking what you want to output.
- In the output popup window type (with double quotes) “Hello World”.
- You can optionally change the speed of execution using the scrolling pointer given immediately after the buttons toolbar.
Flowchart for calculating Area of Circle
The formula to calculate area of circle is Area = 3.1415 * radius * radius
It’s clear that the only variable in the above formula is “radius” of the circle, this means we require it as an input from user to get a meaningful answer of the expression.
- Select the New option from File menu
- Place the Input Symbol from the list of
- Place the Assignment Symbol just below the Input
- Finally place an Output Symbol after the Assignment and just before the End
- Double click on the input symbol and tell the Raptor the message you want to display in the Prompt section and the variable name in which you want to store the input from the
- Double click the Assignment Symbol and introduce a new variable named “area” in the Set field and the formula for expression in the “to” field.
- Double click the Output Symbol and tell the Raptor what you want to display as output, the literal message in double quotes concatenated with the plus symbol and the variable whose value you want to display.
“The Area of Circle with Radius ” + radius + ” is ” + area
- Execute the flow chart, give the required input for “radius” and verify the
Update Activity 2 to calculate Perimeter of Circle (2*3.1415*radius) along with Area
- Create a flowchart that prompts the user to enter two points (x1, y1) and (x2, y2) and displays their distance between The formula for computing the distance is sqrt((x2 – x1)2 + (y2 – y1)2). Note that you can use the built-in method sqrt(x) for calculating square root of a given number.
- Given an airplane’s acceleration a and take-off speed v, you can compute the minimum runway length needed for an airplane to take off using the following formula:
length = (v * v)/(2*a)
Draw a flowchart that prompts the user to enter v in meters/second and the acceleration a in meters/second squared and displays the minimum runway length.