Site icon TestingDocs.com

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:

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.

  1. Declare Array variable to hold 10 numbers.
  2. Invoke the InitArray() module. This module initializes the array with the user input numbers.
  3. Invoke the PrintArray() module. This module prints the array to the output screen.
  4. 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:

Exit mobile version