This Flowgorithm tutorial walks you through one small but complete program: it asks for a test score and tells the user whether they passed. Along the way you'll use the shapes that appear in almost every beginner exercise — Declare, Input, Output and If — and you'll see the program run, step by step, inside Flowgorithm.
You'll need Flowgorithm installed on a Windows PC. If you haven't done that yet, follow the installation steps on the homepage first, then come back.
What you'll build
The finished flowchart does four things in order:
- Creates a whole-number variable called
score. - Prompts the user and reads a number into
score. - Checks whether
scoreis 50 or more. - Prints
PassorTry againdepending on the answer.
That is sequence, input, selection and output — the core of every introductory programming course — in six shapes.
Step 1: Open a new program
When you start a new file, Flowgorithm gives you a Main function already drawn: a rounded start terminal, a rounded end terminal and a single connecting line. Everything your program does will sit on that line, between the two terminals.
Save the file straight away so you don't lose work. Flowgorithm programs use the .fprg extension, which you'll see again when you share or submit files.
Step 2: Declare a variable
Click the connecting line between the two terminals. A menu of shapes appears; choose Declare. Double-click the new shape to edit it, type score as the name and choose Integer as the type.
Flowgorithm insists on declaring a variable before you use it. That's deliberate: it builds the same habit you'll need in Java, C# or C++. The four basic types are:
| Type | Holds | Example value |
|---|---|---|
| Integer | Whole numbers | 42 |
| Real | Numbers with decimals | 3.75 |
| String | Text | "Hello" |
| Boolean | True or false | true |
Step 3: Ask the user for a value
Click the line below your Declare shape and add an Output shape. Give it the expression "Enter your score" — the quotation marks tell Flowgorithm this is text, not a variable name.
Below that, add an Input shape and enter score. When the program runs, it will pause here and wait for the user to type a number, then store it in the variable.
print() followed by input() in Python.Step 4: Add a decision
Add an If shape below the Input. Its condition is score >= 50. The diamond splits into two branches, labelled True and False, and Flowgorithm redraws the chart to make room.
On the True branch, add an Output shape with "Pass". On the False branch, add an Output with "Try again". Both branches rejoin below the diamond and continue to End.
Because Flowgorithm accepts both C-style and BASIC-style operators, you can usually write comparisons the way your course or textbook does.
Step 5: Run it and watch
Press Run. By default, the console looks like a chat: the program's prompt appears as a message bubble, and the number you type appears as a reply. Type 72 and you should see Pass; run it again with 31 and you should see Try again.
Now try stepping through instead of running. Each step highlights the shape that's about to execute, and the Variable Watch window shows the current value of score. Watching a value change at the exact shape that changes it is the single most useful debugging habit you can build early.
Step 6: Look at the generated code
Open the Source Code Viewer and pick a language. The same program appears as real code, and selecting a shape highlights the matching lines. In Python, the logic looks roughly like this:
score = 0
print("Enter your score")
score = int(input())
if score >= 50:
print("Pass")
else:
print("Try again")
Flowgorithm's own output may be laid out a little differently, but the structure is identical. Our guide to turning flowcharts into Python, Java and C++ goes further.
Extend the program
- Grade bands: nest a second If on the True branch to separate Pass from Distinction at 70 or above.
- Validation: wrap the Input in a While loop that repeats until the score is between 0 and 100.
- Several students: add a For loop around the whole thing and count how many passed.
Each of these patterns appears in our Flowgorithm examples guide.
Common first-program mistakes
- Forgetting the Declare shape, so Flowgorithm reports an unknown variable.
- Leaving out quotation marks around text in an Output shape.
- Declaring
scoreas a String, then comparing it with a number. - Putting the Input above the Declare shape — order matters.
If you hit something else, our troubleshooting guide covers the usual suspects.