TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

Flowgorithm

Create Variables in Flowgorithm Flowchart

Flowgorithm

Overview

To use the variables in a flowchart we need to create them. Variables are named memory locations to hold or store data in the program. The flowchart identifies each variable with a name called an Identifier.

Creating variables in a Flowgorithm flowchart is a two-step process.

  • Declare the variable
  • Assign a value to the variable.

Declare Variable

We use the Declare shape to declare a variable. Give a name for the variable and specify the data type. To add the declare shape to the flowchart, click on the flow control arrow line between the Main and End symbols.

Select the Declare symbol from the symbols pop-up window. Click on the Declare shape to add it.

 

Declare Symbol Flowgorithm

 

Double click on the Declare shape to open the Declare properties Window. We can give the variable name and set the data type from the Type drop-down. Please note that Identifiers must start with a letter and avoid naming variables with reserved words.

 

Declare properties Window

Assign value

To assign a value to a variable, double-click on the line and choose the Assign shape. Double-click on the Assign shape to bring up the Assignment Properties window. Enter the variable name and the appropriate value and click on the OK button.

 

Assignment Properties Window

Example

Sample Declare and Assign shapes in a flowchart. A foo variable is declared as an Integer data type. The foo variable is assigned 25 as the value.

When we assign a value to the variable for the first time it’s called the variable initialization. In this example, we have initialized the variable foo to 25.

Declare and Assign Shapes

Constant vs Variable

In the above example, the foo variable can be re-assigned to another value in the program flow. A variable can change its value during the flowchart or program run. On the other hand, Constant doesn’t change its value during the program run. The value of the constant will be the same throughout the flowchart/program.

Example:

pi = 3.1415 (approx)

pi value is a constant in the program. The value of pi is predefined by the Flowgorithm. We can use constants in the flowchart. Once assigned the value of the constant would not change during the program run. It’s a good programming practice to denote user-defined constants in the flowcharts in uppercase.

—

Flowgorithm Tutorials

Flowgorithm flowchart tutorials on this website:

https://www.testingdocs.com/flowgorithm-flowchart-tutorial/

Flowgorithm Website

For more information on the Flowgorithm tool, please visit the official website at:

http://flowgorithm.org/

Related Posts

Print Triangle Pattern Flowchart

Flowgorithm /

Print Triangle Pattern Flowchart

Flowgorithm Breakpoint Symbol

Flowgorithm /

Flowgorithm Conditional Breakpoint Statement

File Read Declare Variables

Flowgorithm /

Flowgorithm Read Numbers from File Example

File Search Input File Flowgorithm

Flowgorithm /

Search Text File Flowchart Example

Flowgorithm Turtle Graphics Symbols

Flowgorithm /

Flowgorithm Turtle Graphics Symbols

‹ IBM Flowchart Symbols› Flowgorithm Integer Array

Recent Posts

  • Update draw.io on Windows
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com