Flowgorithm Array Example
Flowgorithm Array
In this tutorial, we will practice an array example flowchart and apply the concepts learned in the previous lesson. Concepts in the lesson are:
- Creating an Integer array
- Populating with hardcoded values
- Access array element
https://www.testingdocs.com/flowgorithm-integer-array/
Array Example Flowchart
In this example, we will compute the average of the array elements. However, we will not hardcode the array values and instead prompt the user for the array elements.
The flowchart uses different modules to initialize the array elements with the user prompt. The print module prints the array to the output console. The main function invokes the modules by passing the array as the parameter.
- Declare Array variable to hold 10 numbers.
- Invoke the InitArray() module. This module initializes the array with the user input numbers.
- Invoke the PrintArray() module. This module prints the array to the output screen.
- Invokes the ComputeSum() module. This module will compute the sum of the array elements.
InitArray() procedure
Let’s look at the InitArray() procedure. This function runs a loop to take user input and assign it to the array of elements.
Similarly, we can create the PrintArray() procedure and the ComputeSum() function.
Sample Output
Run the flowchart and verify the flowchart output.
—
Flowgorithm Tutorials
Flowgorithm flowchart tutorials on this website: