Flowgorithm Integer Array
Overview
In this tutorial, we will learn about the 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-by-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. To do this, we use the Declare flowchart symbol.
Double click on the symbol to create the array.
- Enter the array variable name.
- Choose the data type as Integer. Check the radio button option against Integer.
- Check the checkbox Array?
- Enter the size of the array.
- 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: