Flowgorithm Input Statement [ 2024 ]
Flowgorithm Input Statement
In the Flowgorithm flowchart, each action that the computer can perform is represented by a different symbol. An Input statement symbol reads information from a standard input device like the keyboard and stores the value in a flowchart variable.
Input Statement
By default, the input statement is represented with a blue color parallelogram. Before using the input statement, declare an input variable using the Declare symbol.
Let’s declare a variable n
Steps to add the Input symbol to the flowchart:
- To add a flowchart figure/symbol, move the mouse pointer over the control flowline. If a symbol can be added, the line turns orange.
- Double-click or right-click to add a figure. A pop-up window will appear on the screen showing all the flowchart figures that can be added
to the flowchart. - Move the mouse over the blue parallelogram with the wording “Input”. It will be highlighted with a blue rectangle. Click on the figure with the left mouse button and the figure will be inserted into the flowchart.
Initially, the symbol will appear in gray color. The gray color indicates that the flowchart symbol is incomplete. This means that the variable should be specified in the symbol. The Input symbol stores the value in this variable.
Double click on the input symbol and specify the input variable to store the input value.
Specify the variable name in the ‘Enter a variable name below:’ textbox and click on the OK button.
The symbol changes to blue color in the flowchart. The blue color of the input symbol indicates successful creation.
XML Syntax
The Flowgorithm flowchart is internally stored in the XML structure. We can edit the .fprg flowchart file using a text editor.
The Input flowchart symbol is represented as follows:
XML | Flowchart Input Symbol |
<input variable=””/>
The XML input tag for the Input symbol when the variable is not yet assigned to the symbol in the flowchart. |
|
<input variable=”sum”/>
The XML input tag for the input symbol when the variable is assigned to the Input symbol in the flowchart. The variable name is the sum. The input is read from the keyboard and stored in the variable sum. |
Exercise
Declare a variable called the name of datatype String. Prompt the user to enter the name. Store the user input in the variable using an Input symbol.
Print the name to the output screen.
The Flowgorithm Input statement is a handy tool for storing user input in variables.