In this post, we will learn to use procedures in raptor flowcharts. A procedure is a series of steps, to achieve some desired result. We rely on the procedure to perform the task and don’t worry about internal details. This is called procedural abstraction.
In this example, we will create a procedure to calculate area of a rectangle. We will pass the length and width in meters as parameters to the procedure from the main flow chart. The procedure calculates the area and returns the value to the main flow chart.
Steps to create procedure in Raptor
Drag two input symbols for length and width.
We will pass the parameters length and width to the procedure in the flow chart.
Create a procedure. Right click on main >> add procedure.
Add Procedure name.
We need two input parameters for length and width.
one output parameter to return the area of the rectangle to main flow chart.
Check two input parameters and one output parameter.
Area of rectangle is
area= length * width
Call the procedure
To call the procedure drag the Call symbol in the main flow chart.
Pass the parameters.
Drag an output symbol to display the area in the main flow chart.
Click on the execute button to test the flow chart.
You can see that we have calculated the area of the rectangle using a procedure in the flow chart.