Introduction
We can generate C++ source code from Raptor flowchart in many languages like C++, Java, VBA, etc. Let’s see how to generate code for a sample flow chart to add two integers.
Modes
Novice & Intermediate Mode:
In these modes, we can generate code in the following programming languages.
- Ada
- C#
- C++
- Java
- VBA
Object-Oriented mode
In Object-oriented mode, we can only generate code in Java language. To know the modes in Raptor Tool
https://www.testingdocs.com/modes-in-raptor-flowchart/
Steps
Steps to generate code from Raptor flowchart in your favorite language that Raptor supports are as follows:
- Open RAPTOR tool.
- Add flowchart symbols and build your flowchart.
- Execute and Test the flowchart.
- Click the menu option Generate >> Choose the Language
You may execute the flowchart and confirm that it’s working as per the design.
C++ Code generation
Click Generate Menu.
Go to menu Generate and choose a programming language example: C++
A source code file would be generated and automatically opened by default application.
For example, Code:: Blocks IDE is default IDE application for C++ programs on the system.
We may notice that the declaration statement starts with ??. We need to add the data types for the variables in the generated code. Remove all the question mark symbols and add appropriate datatypes for the variables.
Code in C++
#include <iostream> #include <string> using namespace std; int main() { string raptor_prompt_variable_zzyz; ?? a; ?? b; ?? sum; sum =0; raptor_prompt_variable_zzyz ="Enter a"; cout << raptor_prompt_variable_zzyz << endl; cin >> a; raptor_prompt_variable_zzyz ="Enter b"; cout << raptor_prompt_variable_zzyz << endl; cin >> b; sum =a+b; cout << "Sum of a + b="+sum << endl; return 0; }
Related
Generate Java Code from Raptor Flowchart:
https://www.testingdocs.com/generate-java-code-from-raptor-flowchart/
—
Raptor Tutorials on this website can be found at:
https://www.testingdocs.com/raptor-a-flowchart-tool/
RAPTOR official website: https://raptor.martincarlisle.com/