Site icon TestingDocs.com

Flowgorithm Integer Array

Overview

In this tutorial, we will learn Flowgorithm Integer Array. An Integer array is a data structure consisting of a sequence of integers identified by an array index.  This tutorial is a step-to-step guide to creating, storing, and accessing the array element.

Create Integer Array

To use the Array in the flowchart, we need to declare it and specify the data type of the elements it holds. We use the Declare flowchart symbol to declare the array.

 

Double click on the symbol to create the array.

 

  1. Enter the array variable name.
  2. Choose the data type as Integer. Check the radio button option against Integer.
  3. Check the checkbox Array?
  4. Enter the size of the array.
  5. Click on the OK button.

 

Populate Integer Array

We can use the Assign symbol to store the array element. Flowgorithm uses square brackets to store the array element. The general syntax to store the array element is:

arrayVariable[arrayIndex] = value

The arrayIndex starts with 0. The valid range of the array index for an array of size n is [0, n – 1]. For example, if the array size is 6 the valid range of the array index in the Flowgorithm is 0 to 5.

For example, to store a value 10 as the first array element, we use the array index 0:

Access Array elements

To avoid errors, we need to store array elements prior to accessing them. We can access the array elements with the array subscript. For example, to access the first element in the array we can use the following syntax:

arrayVariable[0]

Example

The example flowchart to declare an array variable called arr of size three. Store numbers in the array. Access and output the array values using the Output flowchart symbol.

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/

Exit mobile version