Getting User Input in Flowgorithm Flowchart
In this tutorial, we will learn the steps involved in getting user input in the Flowgorithm flowchart. We have discussed assigning a value to the variable using the Assign shape.
The general steps to take user input in the flowchart are as follows:
- Declare a variable to hold the user input data.
- Prompt the user with a user-friendly message.
- Save the user input to the variable.
To get a better understanding, we will design a flowchart to greet the user. The flowchart prompts the user to enter his/her name. The flowchart saves the user name and then greets the user.
Launch the Flowgorithm application. Declare a variable to hold the user name. Let’s name the variable as UserName. The data type of the variable should be String.
An Output shape is used to display data on the computer screen. We can use expressions and variables in the Output shape.
Add an Output shape to the flowchart. This is to prompt the user to enter the name. Left click on the flowchart arrow line and choose the Output shape.
Double click on the Output shape. Enter the user prompt message and click on the OK button.
An Input shape reads the input from the keyboard and stores the data in the specified variable. Add an Input shape to store the user input and assign it to the variable declared in the first step. Double click on the Input shape and enter the variable name. Click on the OK button.
Add another Output shape to display the greeting to the user. Let’s personalize the greeting and add the name of the user. Double click on the Output shape and enter the expression in the Expression box.
“Hello , ” & UserName
& is the concatenation operator in Flowgorithm. The concatenation operator joins the strings and combines it as one String. For example, if the UserName variable holds “John” then the expression would be:
“Hello , ” & UserName -> “Hello , John”
Run the Flowchart
Click on the green play button in the Toolbar to run the flowchart.
- Green button to run the flowchart.
- The user prompt is displayed by the flowchart.
- User Input to the flowchart. (John)
- Flowchart output. ( Hello , John )
Flowgorithm flowchart tutorials on this website:
For more information on the Flowgorithm tool, please visit the official website at: