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

Flowgorithm

Populate Array with User Input in Flowchart

Overview

In the earlier tutorial, we learned about Array in flowcharts. However, we have hardcoded the array elements. This tutorial will teach us to populate an array with user input. The contents in the array would be dynamic.

Flowgorithm Flowchart

The ‘fruits’ is the array variable. The array holds fruit names i.e String data type. The array size is 5.

The ‘index’ is the Array index variable. The legal values of the array index variable in this example are from 0 to 4.

 

Populate Array Flowgorithm Flowchart

Loops

The flowchart uses two ‘for loops’. The first loop is to populate the array contents from the user and the second loop to output the contents of the array to the console window. A for loop is used because we know the array size beforehand and how many times to iterate the loop.

For loop in Flowgorithm

https://www.testingdocs.com/for-loop-statement-in-flowgorithm/

Sample Output

Execute the flowchart. Click on the Green run command to execute the flowchart.

The flowchart prompts the user to enter 5 fruit names. The names are stored in the fruits array.

Populate Array Output

Bad Subscript Error

The below sample error is when we attempt to store or access array element that is not within the valid range:

 

Bad Subscript Array

—

Flowgorithm Tutorials

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

Flowgorithm Website:

http://flowgorithm.org/

Related Posts

Initial Blank Flowchart Flowgorithm3

Flowgorithm /

Draw a Square using Turtle Graphics

File Not Found Flowgorithm Flowchart

Flowgorithm /

Flowgorithm File Errors

File Open Write Mode Statement

Flowgorithm /

Write to Text File using Flowgorithm

File Open Read Mode Flowgorithm

Flowgorithm /

Read Text File using Flowgorithm

New Turtle Graphics Symbols

Flowgorithm /

Flowgorithm Turtle Graphics Flowchart

‹ Recursion in Flowgorithm Flowchart› Flowgorithm Source Code Viewer

Recent Posts

  • Flowchart Control structures
  • Draw a Square using Turtle Graphics
  • Flowgorithm File Errors
  • Write to Text File using Flowgorithm
  • Read Text File using Flowgorithm
  • Flowgorithm Turtle Graphics Flowchart
  • Update Flowgorithm to Latest Version
  • Flowgorithm File Symbols
  • Flowgorithm Turtle Graphics
  • Flowgorithm 3 New Features

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version